Monitoring by SNMP

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.
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Monitoring by SNMP

Post by Cristhian_Plaza »

Hi, I have a question, I have two Nagios Core servers, I want to monitoring a Ubuntu and RHEL 7 server by snmp. I'll give an example for my problem because I don't understand what is happening.
With the first Nagios Core server, I am monitoring the ram memory used and free disk by snmp on a Ubuntu server without problem.
With the second Nagios Core server, I am monitoring the ram memory used by SNMP on a RHEL 7 server without problems, but free disk is going wrong I don't know why, why can I monitoring the memory RAM used by SNMP and cannot monitoring free disk by SNMP?.
Of course I installed net-snmp-utils, net-snmp, net-snmp-libs and configured the snmpd.conf on RHEL7, so I don't understand what is the problem.
The answer of Nagios is, External command error: Error in packet.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring by SNMP

Post by rkennedy »

Can you post the two service definitions, and related command definitions from each machine? Please identify which is which, so we can see the difference you're achieving on your disk result.
Former Nagios Employee
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Monitoring by SNMP

Post by Cristhian_Plaza »

Yes, the services are defined in the same way.

My two Nagios servers are on CentOS

First server.
Command and Services on Ubuntu 14.04

Code: Select all

define command {
          command_name                 snmp_RamSize
          command_line                   $USER1$/check_snmp -o .1.3.6.1.4.1.2021.4.5.0 -H $HOSTADDRESS$ $ARG1$
}

define command {
          command_name                snmp_DiskAvailable
          command_line                  $USER1$/check_snmp -o .1.3.6.1.4.1.2021.9.1.7.1 -H $HOSTADDRESS$ $ARG1$
}

define service {
          use                                   generic-service
          host_name                        LinuxPruebas
          service_description           Tamaño de RAM
          check_command               snmp_RamSize!-C public
}

define service {
          use                                   generic-service
          host_name                        LinuxPruebas
          service_description           Espacio Libre 
          check_command               snmp_DiskAvailable!-C public
}
In that services there isn't problem, it works fine.

Second service
Commands and services on RHEL 7

Code: Select all

define command {
          command_name               Ram_tamaño
          command_line                 $USER1$/check_snmp -o .1.3.6.1.4.1.2021.4.5.0 -H $HOSTADDRESS$ $ARG1$
}

define command {
          command_name               Disco_disponible
          command_line                 $USER1$/check_snmp -o .1.3.6.1.4.1.2021.9.1.7.1 -H $HOSTADDRESS$ $ARG1$
}

define service {
          use                                  generic-service
          host_name                       GLPI
          service_description          Ram asignado
          check_command              Ram_tamaño!-C public!
}

define service {
          use                                  generic-service
          host_name                       GLPI
          service_description           Disco disponible
          check_command              Disco_disponible!-C public!
}
Here is the problem, memory RAM (Ram_tamaño) is working fine, but free disk (Disco_disponible) is not workgin fine, the error is:
External command error: Error in packet, so I don't understand.
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Monitoring by SNMP

Post by Cristhian_Plaza »

rkennedy wrote:Can you post the two service definitions, and related command definitions from each machine? Please identify which is which, so we can see the difference you're achieving on your disk result.
I answered, please look for my topic.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Monitoring by SNMP

Post by avandemore »

Please run the full command on the command line. List the entire output. Example:

Code: Select all

# /usr/local/nagios/libexec/check_snmp -o .1.3.6.1.4.1.2021.9.1.7.1 -H localhost -C public
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.2021.9.1.7.1
Previous Nagios employee
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Monitoring by SNMP

Post by Cristhian_Plaza »

avandemore wrote:Please run the full command on the command line. List the entire output. Example:

Code: Select all

# /usr/local/nagios/libexec/check_snmp -o .1.3.6.1.4.1.2021.9.1.7.1 -H localhost -C public
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.2021.9.1.7.1
I'm getting crazy...,
I have one Nagios server for test another Linux Server and another Nagios Server for the Job.
The Nagios Server for testing is working fine when monitoring a Ubuntu Server 14.04
The Nagios Server for Job is not working fine.

The Services that I'm monitoring in the two Nagios Servers are the same.

the response that you required is:

Code: Select all

External command error: Error in packet
Reason: (noSuchName) there is no such variable name in this MIB
Failed object: iso.3.6.1.4.1.2021.9.1.7.1
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Monitoring by SNMP

Post by dwhitfield »

try $USER1$/check_snmp -o 1.3.6.1.4.1.2021.9.1.7.1.0 -H $HOSTADDRESS$ $ARG1$

OIDs typically end with .0, the .0 indicates that it's a value. Notice that the RAM check ends in a .0.
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Monitoring by SNMP

Post by Cristhian_Plaza »

dwhitfield wrote:try $USER1$/check_snmp -o 1.3.6.1.4.1.2021.9.1.7.1.0 -H $HOSTADDRESS$ $ARG1$

OIDs typically end with .0, the .0 indicates that it's a value. Notice that the RAM check ends in a .0.
I tried, but got the same response, I don't know if is problem of Nagios, or problem from the another server. Why I can monitoring that OID from a Ubuntu server but cannot do it from a CentOS server. If you want see the difference I can give you the url from two servers.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Monitoring by SNMP

Post by dwhitfield »

Sure, if you want to PM them out of security concerns, that works. If no security concerns, you'll get quicker feedback if you post them in the thread.

If you do PM, please update this thread that you have done so. You updating this thread means it will pop back up on our dashboard.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Monitoring by SNMP

Post by avandemore »

Cristhian_Plaza wrote:

Code: Select all

External command error: Error in packet
Reason: (noSuchName) there is no such variable name in this MIB
Failed object: iso.3.6.1.4.1.2021.9.1.7.1
If that is your response, then the SNMP daemon on the system doesn't support that OID.
Previous Nagios employee
Locked