Monitor application on remote Centos

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.
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Monitor application on remote Centos

Post 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:
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitor application on remote Centos

Post by rkennedy »

What is the error message that you receive when trying to snmpwalk on the remote server?
Former Nagios Employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Monitor application on remote Centos

Post 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?)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Re: Monitor application on remote Centos

Post 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
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Re: Monitor application on remote Centos

Post 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/
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Re: Monitor application on remote Centos

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitor application on remote Centos

Post 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
Former Nagios employee
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Re: Monitor application on remote Centos

Post 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 :(
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor application on remote Centos

Post 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.
Former Nagios Employee.
me.
joulsn
Posts: 19
Joined: Fri Nov 06, 2015 10:42 am

Re: Monitor application on remote Centos

Post 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?
Locked