08-10-2005
I finally found how to retrieve router configs using snmp.
using snmpset the command is
snmpset -v1 -c READ-WRITE-STRING ROUTER-IP .1.3.6.1.4.1.9.2.1.55.TFTP-SERVER-IP s FILE-NAME
The READ-WRITE-STRING is the snmp-server community rw string and the TFTP-SERVER-IP is appended at the end of the OID. FILE-NAME is the file name the config will be saved as on the tftp server. The file must already exist in the tftpboot directory.
The following MIBS must exist on the querying server.
CISCO-SMI-V1SMI.my
SNMPv2-TC-V1SMI.my
CISCO-CONFIG-COPY-MIB-V1SMI.my
CISCO-FLASH-MIB.my
This will not work on all cisco routers.
Thought someone might find this useful sometime.
7 More Discussions You Might Find Interesting
1. HP-UX
Dear All,
Please help me, how to install net-snmp step by step, so i can monitoring disk, cpu, memory usage by Solarwind
Many thanks !!
Vu. (1 Reply)
Discussion started by: Nguyen Quang Vu
1 Replies
2. IP Networking
Hi ,
Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies
3. Red Hat
Hi ,
Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies
4. UNIX for Advanced & Expert Users
Hello,
I need to create an snmp.comf file that defines 2 IPs to the same community string.
Do I need to have 2 community strings with the same name and diff't IPs?
Or should I have 1 string and list the IPs? (comma seperated?)
Example:
rocommunity EC_8000_RO
arguments EC_8000_RO... (2 Replies)
Discussion started by: felbvts
2 Replies
5. IP Networking
I am having a problem with an SNMP event, and I am not sure where I should be looking to solve this problem.
Description:
There is an SNMP event in our system that for one reason or another is not getting sent out as an email because it is never getting to our SNMP agent.
I see where the... (0 Replies)
Discussion started by: broberts
0 Replies
6. Infrastructure Monitoring
Dear Champs,
I am new to unix, and need to configure linux server to send below traps to a SNMP server.
Monitoring TRAP Disk Space Low
Monitoring TRAP Memory Low
Monitoring TRAP CPU high
Monitoring TRAP Admin login/Logoff
Please help me how to send this information to my SNMP server... (2 Replies)
Discussion started by: stavar
2 Replies
7. UNIX for Dummies Questions & Answers
i am working with embedded system -Dell DCS management sub system. my question is as below:
currently we are using linux kernel 2.6.30 build and we have a kernel logs stored to the /var/log/messages path. now we have to transfer all this logs to the specified SNMP target as a part of SNMP... (4 Replies)
Discussion started by: vipul_prajapati
4 Replies
SNMPSET(3) 1 SNMPSET(3)
snmpset - Set the value of anSNMPobject
SYNOPSIS
bool snmpset (string $host, string $community, string $object_id, string $type, mixed $value, [int $timeout = 1000000], [int
$retries = 5])
DESCRIPTION
snmpset(3) is used to set the value of an SNMP object specified by the $object_id.
PARAMETERS
o $host
- The hostname of the SNMP agent (server).
o $community
- The write community.
o $object_id
- The SNMP object id.
o $type
- The MIB defines the type of each object id. It has to be specified as a single character from the below list.
types
+--+--------------------------------+
|= | |
| | |
| | The type is taken from the MIB |
| | |
|i | |
| | |
| | INTEGER |
| | |
|u | |
| | |
| | INTEGER |
| | |
|s | |
| | |
| | STRING |
| | |
|x | |
| | |
| | HEX STRING |
| | |
|d | |
| | |
| | DECIMAL STRING |
| | |
|n | |
| | |
| | NULLOBJ |
| | |
|o | |
| | |
| | OBJID |
| | |
|t | |
| | |
| | TIMETICKS |
| | |
|a | |
| | |
| | IPADDRESS |
| | |
|b | |
| | |
| | BITS |
| | |
+--+--------------------------------+
If OPAQUE_SPECIAL_TYPES was defined while compiling the SNMP library, the following are also valid:
types
+--+----------------+
|U | |
| | |
| | unsigned int64 |
| | |
|I | |
| | |
| | signed int64 |
| | |
|F | |
| | |
| | float |
| | |
|D | |
| | |
| | double |
| | |
+--+----------------+
Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET
STRING value, and the 'u' unsigned type is also used for handling Gauge32 values. If the MIB-Files are loaded by into the MIB Tree
with "snmp_read_mib" or by specifying it in the libsnmp config, '=' may be used as the $type parameter for all object ids as the
type can then be automatically read from the MIB. Note that there are two ways to set a variable of the type BITS like e.g. "SYNTAX
BITS {telnet(0), ftp(1), http(2), icmp(3), snmp(4), ssh(5), https(6)}":
o Using type "b" and a list of bit numbers. This method is not recommended since GET query for the same OID would return e.g.
0xF8.
o Using type "x" and a hex number but without(!) the usual "0x" prefix.
See examples section for more details.
o $value
- The new value.
o $timeout
- The number of microseconds until the first timeout.
o $retries
- The number of times to retry if timeouts occur.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
If the SNMP host rejects the data type, an E_WARNING message like "Warning: Error in packet. Reason: (badValue) The value given has the
wrong type or length." is shown. If an unknown or invalid OID is specified the warning probably reads "Could not add variable".
EXAMPLES
Example #1
Using snmpset(3)
<?php
snmpset("localhost", "public", "IF-MIB::ifAlias.3", "s", "foo");
?>
Example #2
Using snmpset(3) for setting BITS SNMP object id
<?php
snmpset("localhost", "public", 'FOO-MIB::bar.42', 'b', '0 1 2 3 4');
// or
snmpset("localhost", "public", 'FOO-MIB::bar.42', 'x', 'F0');
?>
SEE ALSO
snmpget(3).
PHP Documentation Group SNMPSET(3)