Page 1 of 1

Nagios Quick Action question

Posted: Tue Aug 30, 2016 12:19 pm
by SteveBeauchemin
Hi,

I am looking at making use of Quick Actions, and extending Nagios XI to send data to 'places'. So I am looking at the variable names that can be passed.
My question is about the hostchecktype variable.

Looking in the code, the function actions_component_get_host_vars and function actions_component_get_service_vars
are in place in the file actions.inc.php (in /usr/local/nagiosxi/html/includes/components/actions)

The Host Function shows this:
(near line 1116) :

Code: Select all

"hostchecktype" => strval($hoststatus_xml->hoststatus->check_type),
The Service Function shows both of these:
(near line 1227) :

Code: Select all

"hostchecktype" => strval($servicestatus_xml->servicestatus->check_type),
and
(near line 1258) :

Code: Select all

"hostchecktype" => strval($servicestatus_xml->servicestatus->host_check_type),
In the Service Function, should line 1227 be servicechecktype?

Is that a typo? It looks like to 2 variable names conflict.

Just wondering...

Thanks.

Steve B

Re: Nagios Quick Action question

Posted: Tue Aug 30, 2016 2:46 pm
by ssax
No, it is proper. Both DB fields are called check_type so the host one is labeled as host_check_type in the SQL query to differentiate them. The first one you posted is only querying the host so an alternate label is not needed.

Re: Nagios Quick Action question

Posted: Tue Aug 30, 2016 3:52 pm
by SteveBeauchemin
so is there no servicechecktype?

Re: Nagios Quick Action question

Posted: Tue Aug 30, 2016 4:07 pm
by ssax
Actually, after looking at it again, you are correct. :oops:

Line 1227 (or thereabouts) should be:

Code: Select all

"servicechecktype" => strval($servicestatus_xml->servicestatus->check_type),

Re: Nagios Quick Action question

Posted: Wed Aug 31, 2016 12:07 pm
by SteveBeauchemin
okay, I'm not crazy... Please close this up - after you fix it in your code for the future...

Thanks

Re: Nagios Quick Action question

Posted: Wed Aug 31, 2016 12:19 pm
by lmiltchev
Thanks for reporting this, SteveBeauchemin! I am closing the thread.