Page 1 of 1

SNMP check through a port foward

Posted: Fri Aug 24, 2012 1:34 pm
by rafaelvdberg
I'm running Nagios XI (trial) on VMware player. I downloaded and installed the VM from the Nagios website.

I'm having some issues with setting up monitoring a device behind a port forward. (i.e. I port forwarded port 161 [snmp] to a device behind a firewall).

I used the "SNMP Monitor Wizard" to create the device and added the services I wanted to monitor, however it doesn't work.

I looked into the service detail for one of the MIBs i'm trying to capture and found this:

CMD: /usr/bin/snmpget -t 1 -r 5 -m RFC1213-MIB -v 2c [authpriv] ipvegas.hotelwifi.com:64161:161 ifOperStatus.3

As you can see, it's adding port 161 (:161) after the port forward which I'm guessing is the reason it is not working.

Can someone help me with this?

Best,

Rafael

Re: SNMP check through a port foward

Posted: Fri Aug 24, 2012 1:56 pm
by scottwilkerson
Did you forward 161 TCP or UDP?

Re: SNMP check through a port foward

Posted: Mon Aug 27, 2012 11:02 am
by rafaelvdberg
Yes - but as you can see Nagios is adding a :161 to the end of the address.

Re: SNMP check through a port foward

Posted: Mon Aug 27, 2012 11:50 am
by scottwilkerson
I'm sorry, I didn't realize you were adding it to the host.

Instead of doing that you should add the port to the $ARG1$ field with check_snmp 's -p parameter.

Code: Select all

-p 64161

Re: SNMP check through a port foward

Posted: Mon Aug 27, 2012 5:04 pm
by rafaelvdberg
Okay, thanks.

So currently the $ARG1$ is: -o ifOperStatus.3 v2c -C c0c01509hki -m RFC1213-MIB -r "1"

I should change this to read: -o ifOperStatus.3 v2c -C c0c01509hki -m RFC1213-MIB -r "1" -p 64161

Right?

Re: SNMP check through a port foward

Posted: Mon Aug 27, 2012 5:09 pm
by scottwilkerson
yep.

Re: SNMP check through a port foward

Posted: Mon Aug 27, 2012 5:38 pm
by rafaelvdberg
Okay, that worked (I had to put -p 64161 ) in front.

However, it still shows my host as down, with the services (SNMP services) up.

I looked into the host and it seems that this is because the host is being monitored by ICMP. Here is what is shows under host detail: check_icmp: Failed to resolve ipvegas.hotelwifi.com:64161

ICMP obviously won't work in this scenerio. I'd rather have it do a HTTP check to port 50011 to check host status. How do I change it to that?

Best,

Rafael