Page 1 of 2

Monitor application on remote Centos

Posted: Fri Nov 06, 2015 11:10 am
by joulsn
Hey guys,

I'm new here. I've already looked for similar topics, but I was not successful to solve my Problem.

Situation: I have Nagios Core 4.04 running on my monitoring server. I can successful monitor my switch and windows machine. But my goal is to monitor generated events from an application server (Centos 6.6) that triggers events. The application triggers events e.g. if a hardware issue occurs or if users are logged in etc. .
The application provides a mib.txt.


My try:
On the monitoring server I placed the mib.txt to /usr/share/snmp/mibs.
I have net-snmp && snmp-utils on both, the monitoring server and the application server.
On the monitoring server i can run: snmpwalk -v 1 -c public -O e 127.0.0.1 successfully. But not snmpwalk -v 1 -c public -O e IP_OF_REMOT_CENTOS_SERVER.

Do you guys know what I am doing wrong? btw I am really not an expert....
I am happy about every comment. Even if you just say hello ;)
:D

Greetings from Vienna, Austria :mrgreen:

Re: Monitor application on remote Centos

Posted: Fri Nov 06, 2015 2:59 pm
by rkennedy
What is the error message that you receive when trying to snmpwalk on the remote server?

Re: Monitor application on remote Centos

Posted: Fri Nov 06, 2015 3:41 pm
by eloyd
My first thoughts:

Network firewall is prohibiting SNMP ports 161 and/or 162.
iptables on remote host is not allowing SNMP ports 161 and/or 162.
No snmpd is listening on the remote host (can you snmpwalk localhost from the remote host?)

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 3:54 am
by joulsn
rkennedy wrote:What is the error message that you receive when trying to snmpwalk on the remote server?
Hi thanks for helping me ;)

Firewall on both servers is stopped.
1) snmpwalk local on linux server: When i run "snmpwalk -v 1 -c public -O e 127.0.0." on the remote linux host i get "Timeout: No Response from 127.0.0.1".

2) snmpwalk from monitoring server to remote linux server:
[root@NagiosServer ~]# snmpwalk -v 1 -c public -O e 10.10.10.74
No log handling enabled - turning on stderr logging
/etc/snmp/snmp.conf: line 1: Warning: Unknown token: rocommunity.
/etc/snmp/snmp.conf: line 2: Warning: Unknown token: syslocation.
/etc/snmp/snmp.conf: line 3: Warning: Unknown token: syscontact.
Timeout: No Response from 10.10.10.74

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 4:11 am
by joulsn
eloyd wrote:My first thoughts:

Network firewall is prohibiting SNMP ports 161 and/or 162.
iptables on remote host is not allowing SNMP ports 161 and/or 162.
No snmpd is listening on the remote host (can you snmpwalk localhost from the remote host?)
Hi,

thanks for the support.
I turned off the firewall on both servers.
To your last point: no I can't. I get a no response message when I try to snmp-walk localhost on the remote server:
[root@obelix ~]# snmpwalk -v 1 -c public -O e 127.0.0.1
Timeout: No Response from 127.0.0.1
[root@obelix ~]#


The strange thing is that snmpd seems to be running:
[root@obelix ~]# service snmpd status
snmpd (pid 8173) is running...
[root@obelix ~]#


I installed net-snmp & snmp-utils according to :
http://www.it-slav.net/blogs/2008/11/11 ... or-centos/

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 6:16 am
by joulsn
hey all,

now I am able to snmpwalk the remote linux server from the monitoring server.
[root@NagiosServer libexec]# snmpwalk -v 1 -c public -O e 10.10.10.74 .1.3.6.1.4.1.2021.4.11.0
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 1057244 kB


My question now: how can I monitor the OIDs from the custom MIB?

BR

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 10:17 am
by tmcdonald
One of the users over at the LinuxQuestions forum did a great write-up for how to do an SNMP check:

http://www.linuxquestions.org/questions ... ost3673978

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 11:59 am
by joulsn
tmcdonald wrote:One of the users over at the LinuxQuestions forum did a great write-up for how to do an SNMP check:

http://www.linuxquestions.org/questions ... ost3673978
Hey thanks for the link. Now i can snmpwalk the remote host. Only thing not working-> I cant snmpwalk the custom MIB.

I can run successfully run ./check_snmp -H 10.10.10.74 -C public -o .1.3.6.1.2.1.1.4.0 //(SNMPv2-MIB::sysContact.0)

When I run snmpwalk -v 1 -c public -O e 10.10.10.74 it walks trough most of the MIBs from /usrshare/snmp/mibs with its objects and values.
My problem is that the MIB of the application which I want to monitor is not even shown although I have put it to /usr/share/snmp/mibs.
I tried:
[]# ./check_snmp -v 1 -c public -O e 10.10.10.74 APP-MIB::1.3.6.1.4.1.33687.1.1.1.1.1.2.0
//output: No OIDs specified

[]# ./check_snmp -v 1 -c public -O e 10.10.10.74 .1.3.6.1.4.1.33687.1.1.1.1.1.2.0
//output: No OIDs specified

[]# snmpwalk -v 1 -c public -O e 10.10.10.74 .1.3.6.1.4.1.33687.1.1.1.1.1.2.0
//no output

[]# snmpwalk -v 1 -c public -O e 10.10.10.74 APP-MIB::.1.3.6.1.4.1.33687.1.1.1.1.1.2.0
output: No log handling enabled - turning on stderr logging
APP-MIB::.1.3.6.1.4.1.33687.1.1.1.1.1.2.0: Unknown Object Identifier

[]# snmpget -v 1 -c public -O e 10.10.10.74 .1.3.6.1.4.1.33687.1.1.1.1.1.2.0
output:
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::enterprises.33687.1.1.1.1.1.2.0


I've also put the ".0" after each OID. I tried every combination. with and without .0!
Seems that it does'nt recognizes my MIB :(

Re: Monitor application on remote Centos

Posted: Mon Nov 09, 2015 6:15 pm
by hsmith
If the OID isn't there when you snmpwalk it as the nagios user, you are going to need to review the settings on the application end. The MIB basically makes it more human readable, it won't increase functionality.

Re: Monitor application on remote Centos

Posted: Tue Nov 10, 2015 4:43 am
by joulsn
hsmith wrote:If the OID isn't there when you snmpwalk it as the nagios user, you are going to need to review the settings on the application end. The MIB basically makes it more human readable, it won't increase functionality.
Hi, I also thouht this way. But when I use a MIB-browser on my PC and connect to the remote host I can get and walk trough everything without problem :/
Any idea?