Lemseffer. Tahar (MSA) wrote:
> Hello all,
> I need to retrieve The SNMP invalid community names counter for all SNMP
> enabled devices in the computer system.
> can anyone point me in the right direction.
> Thanks 
> Tahar
>   
Probably the easiest way to do this would be to use snmpget in a simple 
script that loops over all the device names or IP addresses. I am 
assuming you are referring to the snmpInBadCommunityNames variable (full 
path is .iso.org.dod.internet.mgmt.mib-2.snmp.snmpInBadCommunityNames, 
and the OID is .1.3.6.1.2.1.11.4). So the heart of the loop would 
contain something like:

snmpget -v 2c -c putyourcommunitynamehere puttheipaddresshere 
.1.3.6.1.2.1.11.4

Depending on whether the devices are using SNMP version 1, 2c, or even 
3you will need to change the -v option. If you wish to do it in Perl you 
would probably want to use the Net::SNMP module, which is documented at 
http://search.cpan.org/~dtown/Net-SNMP-5.2.0/lib/Net/SNMP.pm .

You of course would need to know the addresses or hostnames in advance, 
as well as the community string(s).

There isn't, to my knowledge, a simple way of discovering which boxes 
are running SNMP without already knowing the community string and the 
SNMP version number, since SNMP won't respond if anything is incorrect 
with the SNMP query, so simple nmap scans don't work very well.

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to