This section provides examples for using the emphistory utility with SNMP versions 1 and 3. The agent is assumed to be running with default port 161.
Example: List Entries in the History Control Table
The following examples list the contents of the agent's History Control table:
emphistory -h 127.0.0.1 -v 1 -c public -o list
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o list
Example: Add a History Control Entry
The following examples add a new control entry at table index 5 to the agent's History Control table. This control entry instructs the agent to sample the ifInOctets.1 MIB object-instance every 60 seconds and to store the most recent 10 samples:
emphistory -h 127.0.0.1 -v 1 -c private -o add 5 ifInOctets.1 60 10
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o add 5 ifInOctets.1 60 10
Example: Delete a History Control Entry
The following entries delete the History Control table entry at table index 3:
emphistory -h 127.0.0.1 -v 1 -c private -o delete 3
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o setstatus 3 destroy
Note: These entries also instruct the agent to delete the stored data samples in the History table that correspond to this control entry.
Example: Set the Row Status of a Control Entry
The following examples disable the control entry in the History Control table at table index 5, but save the corresponding stored samples in History table:
emphistory -h 127.0.0.1 -v 1 -c private -o setstatus 5 2
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o setstatus 5 2
Corresponds to the RowStatus textual convention value notInService(2).
Example: Retrieve Stored Data Samples
The following examples retrieve all the stored data samples that correspond to the data-collection function defined in row 5 of the History Control table:
emphistory -h 127.0.0.1 -v 1 -c private -o dump 5
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o dump 5
The following examples retrieve all the stored samples for all control entries using -1. This command retrieves the entire contents of the History table:
emphistory -h 127.0.0.1 -v 1 -c private -o dump -1
emphistory -h 127.0.0.1 -v 3 -u username -s 3 -A MD5 -a authPassword -X DES -x encryptPassword -o dump -1
Copyright © 2013 CA.
All rights reserved.
|
|