Page 1 of 1

Check whether snmp sender is active

Posted: Thu Nov 15, 2018 7:40 pm
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

Re: Check whether snmp sender is active

Posted: Fri Nov 16, 2018 3:39 pm
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.