Check whether snmp sender is active

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.
Locked
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Check whether snmp sender is active

Post by grenley »

Hi.
We use the snmptrap sender from Core to a notification tool.
In XI, there is a "Manage Components" check box that tells you if the sender is active.
Aside from the fact that Core doesn't have this dialog, I need to be able to get this status programmatically (from perl).
Is this do-able?
Thanks,
Rick
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check whether snmp sender is active

Post by ssax »

Are you trying to use the SNMP Trap Sender component meant for XI with Core?

If so, the XI trap sender component stores the data in the nagiosxi DB under the xi_options table, Core doesn't have the DB so it's not compatible.

The SQL that would grab it would be:

Code: Select all

select value from xi_options where name = 'snmptrapsender_component_options';
The problem is that it's stored as a php serialized array so you can either unserialize it and process it as an array or you could just search for:

If enabled:

Code: Select all

"enabled";i:1
If disabled:

Code: Select all

"enabled";i:0
It would be up to you to setup a perl script to grab that information.

If that is not what you're doing or trying to do, please be more specific.
Locked