SNMP error.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
UndMe
Posts: 14
Joined: Thu Nov 22, 2018 6:40 pm

SNMP error.

Post 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
Attachments
nagios.PNG
nagios2.PNG
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP error.

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
UndMe
Posts: 14
Joined: Thu Nov 22, 2018 6:40 pm

Re: SNMP error.

Post 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.
Attachments
nagios2.PNG
nagios2.PNG (7.23 KiB) Viewed 3625 times
nagios1.PNG
nagios1.PNG (6.47 KiB) Viewed 3625 times
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP error.

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
UndMe
Posts: 14
Joined: Thu Nov 22, 2018 6:40 pm

Re: SNMP error.

Post 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.
Attachments
nagios2.PNG
nagios2.PNG (10.69 KiB) Viewed 3588 times
nagios1.PNG
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP error.

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
UndMe
Posts: 14
Joined: Thu Nov 22, 2018 6:40 pm

Re: SNMP error.

Post 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
Attachments
nagios2.PNG
nagios error.PNG
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP error.

Post 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.
Attachments
RFC1213-MIB.txt
(77.8 KiB) Downloaded 299 times
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
UndMe
Posts: 14
Joined: Thu Nov 22, 2018 6:40 pm

Re: SNMP error.

Post 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.
Attachments
nagios2.PNG
nagios2.PNG (4.86 KiB) Viewed 3530 times
nagios.PNG
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP error.

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked