Page 1 of 4

Setup Switchvox OID's in serivces

Posted: Tue Dec 17, 2013 8:36 am
by nhajicostis
I need some help configuring services to monitor Digium Switchvox PBX, I have the host setup for my remote PBX's working fine, now I am trying to monitor specific OID's through SNMP and I cannot get the output to work, does anyone have a good tutorial on how to accomplish this.

Thanks
Nick Hajicostis

Re: Setup Switchvox OID's in serivces

Posted: Tue Dec 17, 2013 11:45 am
by abrist
You can use the nagios-plugin "check_snmp" to check these specific oids. You will need to use snmpwalk to identify the oids you wish to monitor if you have not previously identified them. Additionally, port 161 needs to be open and an snmp daemon must be running on the remote device.
https://www.nagios-plugins.org/doc/man/check_snmp.html
http://www.net-snmp.org/docs/man/snmpwalk.html
http://net-snmp.sourceforge.net/docs/man/snmpget.html

Re: Setup Switchvox OID's in serivces

Posted: Tue Dec 17, 2013 11:46 am
by slansing
This is actually a pretty good example:

http://www.linuxjournal.com/magazine/sn ... ing-nagios

It will differ from what you are doing though. Are you using the check_snmp plugin to run active get requests against your OID's? Can you show us an example of you running it against one of your Switchvox OID's, and it's output?

Re: Setup Switchvox OID's in serivces

Posted: Wed Dec 18, 2013 2:09 pm
by nhajicostis
Thanks for the replies, I have a feeling my problem might be the check-snmp plugin is not installed. I will try to get some examples during the next 24 hour

Re: Setup Switchvox OID's in serivces

Posted: Wed Dec 18, 2013 2:22 pm
by abrist
No problem. Let us know when you have some results.

Re: Setup Switchvox OID's in serivces

Posted: Wed Dec 18, 2013 5:22 pm
by nhajicostis
I do have a question, I will preface this with I am a noob when it comes to Nagios, I have a MIB for the OID's I want to use, how do I get Nagios to interpret that file. I used snmpwalk to test the OID's and I get valid data back while in terminal, now I need to setup my service in Nagios to read this OID and send out alerts if a threshold is passed. This is where I am stuck in my configuration. Any help will be greatly appreciated.

Nick

Re: Setup Switchvox OID's in serivces

Posted: Thu Dec 19, 2013 9:41 am
by nhajicostis
I am running into another problem, while testing using snmpwalk, I try to view info off a remote device, using command snmpwalk -v 2c -c public (remote IP address) (OID)

When I use the same command but the IP address is my local Swichvox on the LAN, I get the correct info, when I put in the IP of a remote Switchvox, that the snmp daemon is running on and the firewall is pointing port 161 to the local address of the Switchvox, I get a timeout. Any ideas as to why this is happening. The firewall is a Watchguard XTM router and I am using a Static NAT to route to the Switchvox in my firewall rules.

Nick

Re: Setup Switchvox OID's in serivces

Posted: Thu Dec 19, 2013 11:09 am
by cbeattie
nhajicostis wrote:I have a MIB for the OID's I want to use, how do I get Nagios to interpret that file. I used snmpwalk to test the OID's and I get valid data back while in terminal, now I need to setup my service in Nagios to read this OID and send out alerts if a threshold is passed.
If you have a .mib file, install it in /usr/share/snmp/mibs. That's optional, but it allows you to use a human-readable OID instead of the string of numbers. Then you can set a generic check_snmp command and a service check. I define custom host macros in my host definitions so I can use the same service definition for multiple temperature sensors which all need slightly different thresholds.

Code: Select all

define command {
	command_name	check_snmp
	# $ARG1$ = OID, $ARG2$ = warning threshold, $ARG3$ = critical threshold, $ARG4$ = label, $ARG5$ = units
	command_line	$USER1$/check_snmp $HOSTADDRESS$ -o $ARG1$ -w $ARG2$ -c $ARG3$ -C communityreadstring -l $ARG4$ -u $ARG5$
}

define service {
	use			standard_service
	hostgroup_name		env1
	service_description	Temperature 1
	check_command		check_snmp!temperatureSensor1CurrentValue.0!$_temp1warn$!$_temp1crit$!"Temperature Sensor 1:"!"deg. F"
}

define host {
	use		network_switch
	host_name	foo
	alias		foo
	address		foo
	host_groups	env1,env2
	_hum1warn	56
	_hum1crit	60
	_hum2warn	56
	_hum2crit	60
	_temp1warn	83
	_temp1crit	85
	_temp2warn	85
	_temp2crit	87
}

Re: Setup Switchvox OID's in serivces

Posted: Thu Dec 19, 2013 3:52 pm
by sreinhardt
thanks cbeattie! nhajicostis are you able to see the traffic pass through your firewall? Is there any possibility of running a tcpdump on the switchvox device for port 161 to validate that traffic is actually incoming? Additionally, since it is udp and not tcp, it does not keep a continual stream and will respond on a random port so the firewall may be blocking only the return traffic, just as another thing to look for in your firewall logs.

Re: Setup Switchvox OID's in serivces

Posted: Fri Dec 27, 2013 1:33 pm
by nhajicostis
Here is an update, I have got the check_snmp command to work, the plugin did not compile the first time since i did not have Net-SNMP installed. I get data off my local PBX no problem, I have 1 issue there that the critical threshold I defined is not working, the syntax i am using is as follows check_snmp!-C public -o SWITCHVOX-MIB::svoxAvailableVoipProviders -c <3 . the integer value it pulls is 2, should this work, I read this as if value is less than 3 then Crit, if I am using this argument wrong can someone please show me the proper usage. All of my critical thresholds are less than or greater than arguments.

As well i still can't get any remote queries to work I still get timeout, I have configured both routers at each end to route port udp 161 to either the PBX or the Nagios server depending on which end i am at.

Any help on these issues would be greatly appreciated thanks

Nick Hajicostis