Setup Switchvox OID's in serivces

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.
nhajicostis
Posts: 17
Joined: Mon Dec 09, 2013 10:15 am

Setup Switchvox OID's in serivces

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Setup Switchvox OID's in serivces

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Setup Switchvox OID's in serivces

Post 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?
nhajicostis
Posts: 17
Joined: Mon Dec 09, 2013 10:15 am

Re: Setup Switchvox OID's in serivces

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Setup Switchvox OID's in serivces

Post by abrist »

No problem. Let us know when you have some results.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nhajicostis
Posts: 17
Joined: Mon Dec 09, 2013 10:15 am

Re: Setup Switchvox OID's in serivces

Post 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
nhajicostis
Posts: 17
Joined: Mon Dec 09, 2013 10:15 am

Re: Setup Switchvox OID's in serivces

Post 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
cbeattie
Posts: 19
Joined: Fri Oct 04, 2013 7:12 am

Re: Setup Switchvox OID's in serivces

Post 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
}
Last edited by cbeattie on Fri Dec 20, 2013 11:26 am, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Setup Switchvox OID's in serivces

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
nhajicostis
Posts: 17
Joined: Mon Dec 09, 2013 10:15 am

Re: Setup Switchvox OID's in serivces

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