Page 1 of 2
SNMP error.
Posted: Sat Dec 01, 2018 8:23 am
by UndMe
Hello, I am having problems when configuring the SNMP services in nagios for a cisco 2960G switch.
I can not get the two functions that use SNMP that are: port status and uptime.
I leave a photo so you can see what error is giving me, and if you can help me.
Thank you.
Edit:
I have SNMP protocol enabled on the switch and I can access without problem with the following command:
snmpwalk -v1 -c public 192.168.1.17 |more
Re: SNMP error.
Posted: Mon Dec 03, 2018 3:53 pm
by cdienger
Can you provide the configuration for these two checks? Also try running the commands directly on the command line and provide the commands and outputs.
Re: SNMP error.
Posted: Mon Dec 03, 2018 5:14 pm
by UndMe
cdienger wrote:Can you provide the configuration for these two checks? Also try running the commands directly on the command line and provide the commands and outputs.
The photos of the configuration I leave in the message, the commands that I have to try directly on the command line do not know what they are.
I have put the number 10101 in operstatus because I'm trying, with 1 also gave me the same problem.
thanks.
Re: SNMP error.
Posted: Tue Dec 04, 2018 5:06 pm
by cdienger
The commands would look like:
./check_snmp -H SW-CISCO-2906_address -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
./check_snmp -H SW-CISCO-2906_address -C public -o sysUPtime.0
Run these as nagios by running this first:
su - nagios
Make sure that RFC1213-MIB.txt is in /usr/share/snmp/mibs/ and the permissions give everyone read access:
chmod 644 /usr/share/snmp/mibs/RFC1213-MIB.txt
Re: SNMP error.
Posted: Fri Dec 07, 2018 7:14 am
by UndMe
cdienger wrote:The commands would look like:
./check_snmp -H SW-CISCO-2906_address -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
./check_snmp -H SW-CISCO-2906_address -C public -o sysUPtime.0
Run these as nagios by running this first:
su - nagios
Make sure that RFC1213-MIB.txt is in /usr/share/snmp/mibs/ and the permissions give everyone read access:
chmod 644 /usr/share/snmp/mibs/RFC1213-MIB.txt
When I execute the two commands that you have told me, it gives me a message: permission denied.
I have to change SW-CISCO-2960_address by the ip address of my switch?
The file 1213-MIB.txt I do not have it in the directory that you told me.
Re: SNMP error.
Posted: Fri Dec 07, 2018 3:23 pm
by cdienger
Try:
/usr/local/nagios/libexec/check_snmp -H SW-CISCO-2906_address -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
/usr/local/nagios/libexec/check_snmp -H SW-CISCO-2906_address -C public -o sysUPtime.0
Re: SNMP error.
Posted: Sun Dec 09, 2018 7:10 pm
by UndMe
cdienger wrote:Try:
/usr/local/nagios/libexec/check_snmp -H SW-CISCO-2906_address -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
/usr/local/nagios/libexec/check_snmp -H SW-CISCO-2906_address -C public -o sysUPtime.0
When I execute the commands I get the following errors. (
look photo)
I change the name of SW-CISCO-2906_address by the ip address of the switch, I think it should work as well.
In the next command:
/usr/local/nagios/libexec/check_snmp -H SW-CISCO-2906_address -C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
change: ifOperStatus.1 by ifOperStatus.10101 because when I execute the command to see the port number on the switch it tells me that number for port 1:
show snmp mib ifmib ifindex
Re: SNMP error.
Posted: Mon Dec 10, 2018 3:09 pm
by cdienger
Attached is a copy of RFC1213-MIB.txt. Copy it to /usr/share/snmp/mibs/RFC1213-MIB.txt, and set the permissions so everyone can read it:
chmod 664 /usr/share/snmp/mibs/RFC1213-MIB.txt
then test again and let us know your results.
Re: SNMP error.
Posted: Tue Dec 11, 2018 4:48 pm
by UndMe
cdienger wrote:Attached is a copy of RFC1213-MIB.txt. Copy it to /usr/share/snmp/mibs/RFC1213-MIB.txt, and set the permissions so everyone can read it:
chmod 664 /usr/share/snmp/mibs/RFC1213-MIB.txt
then test again and let us know your results.
I have the same problem.
With the two commands I get an error.
Re: SNMP error.
Posted: Thu Dec 13, 2018 3:11 pm
by scottwilkerson
What operating system are you on? I think you are missing several of the standard MIBs that should have been installed by default when you installed net-snmp