SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-117
SNMPHOST
Example 2-16 illustrates the output SNMPHOST generates when requested to retrieve
information for 25 devices.
Each output line displays MIB object values for one device. For example:
1 CPU00(NSR-P) running D30.02 running CPU load(19 %)
| | | |
| hrDeviceDescr hrDeviceStatus
hrProcessorLoad
|
hrDeviceIndex
The source code for SNMPHOST, contained in a file named snmphosc, uses a structure
and function prototypes declared in a header file named snmphosh.
Example 2-16. Sample SNMPHOST Output
TACL> SNMPHOST -d 25 -a $zsnmp1 mynode
------ RUNNING LOCAL ------
1 CPU00(NSR-P) running D30.02 running CPU load(19 %)
2 CPU01(NSR-P) running D30.02 running CPU load(12 %)
3 CPU02(NSR-P) running D30.02 running CPU load(28 %)
4 CPU03(NSR-P) running D30.02 running CPU load(75 %)
5 CPU04(NSR-P) running D30.02 running CPU load(11 %)
6 CPU05(NSR-P) running D30.02 running CPU load(33 %)
7 CPU06(NSR-P) running D30.02 running CPU load(29 %)
8 CPU07(NSR-P) running D30.02 running CPU load(29 %)
9 CPU08(NSR-P) running D30.02 running CPU load( 7 %)
10 CPU09(NSR-P) running D30.02 running CPU load(16 %)
11 CPU10(NSR-P) running D30.02 running CPU load(15 %)
12 CPU11(NSR-P) running D30.02 running CPU load(30 %)
501 $DOVEA running Printer Status(idle)
502 $GARYO running Printer Status(idle)
503 $GEORGE running Printer Status(idle)
504 $LAZR.#BOOK running Printer Status(idle)
505 $LP247 running Printer Status(idle)
506 $PBB2.#P9 running Printer Status(idle)
507 $PBB3.#P14 down Printer Status(other)
508 $PP1.#P5 running Printer Status(idle)
509 $PP1.#P6 running Printer Status(idle)
510 $PP1.#P7 running Printer Status(idle)
.....ENTER to continue. SPACE to stop. number (0..n) to jump....
511 $PP1.#P8 running Printer Status(idle)
512 $RAVEN running Printer Status(idle)
513 $RAVEN2 running Printer Status(printing)
514 $STAN running Printer Status(idle)