config state & Nagios service behavior
Posted: Thu May 30, 2019 5:17 pm
Hello,
I have two closely related concepts: config state & Nagios service behavior.
Questions of interest:
what are some events that would cause the Nagios service to stop? Specifically as it relates to the API.
Can I check the config state? I'd really be interested in getting the error messages. [see screen cap] Nagios service behavior
I thought that creating services using the force flag and applying the config (in a bad state) repeatedly, would kill Nagios. But I can't recreate that behavior. Recently I had a host that was created, but the hostgroup was set to NULL. Nagios showed that the config was created but there was no entry for that host in the Nagios instance. I had to create the host manually - to which Nagios told me that there was a duplicate entry. The host then showed up and I was able to remove the NULL hostgroup. Upon removing the host I was able to apply the config & restart the Nagios service.
config state
I have a series of daily scripts, I'm looking for a way that I can check the result & possibly remediate the host(s)/service(s) from a bad state programatically. Is there a way to access the error message? There's times where I create a service & the host doesn't exist. Nagios is kind enough to create a host for me, but it doesn't have any parameters and it's set as inactive. Thus, apply_config fails.
The closest behavior I found from the api is: querying the command_id for the apply_config command. Are these status & event codes with respect to the configs?
{'success': 'Apply config command has been sent to the backend.', 'command_id': 61}
[{'command': '17',
'command_id': '61',
'event_time': '2019-05-30 17:48:17',
'processing_time': None,
'result': None,
'result_code': '0',
'status_code': '0',
'submission_time': '2019-05-30 17:48:17',
'submitter_id': '1'}]
Thanks,
Maxwell Ramirez
I have two closely related concepts: config state & Nagios service behavior.
Questions of interest:
what are some events that would cause the Nagios service to stop? Specifically as it relates to the API.
Can I check the config state? I'd really be interested in getting the error messages. [see screen cap] Nagios service behavior
I thought that creating services using the force flag and applying the config (in a bad state) repeatedly, would kill Nagios. But I can't recreate that behavior. Recently I had a host that was created, but the hostgroup was set to NULL. Nagios showed that the config was created but there was no entry for that host in the Nagios instance. I had to create the host manually - to which Nagios told me that there was a duplicate entry. The host then showed up and I was able to remove the NULL hostgroup. Upon removing the host I was able to apply the config & restart the Nagios service.
config state
I have a series of daily scripts, I'm looking for a way that I can check the result & possibly remediate the host(s)/service(s) from a bad state programatically. Is there a way to access the error message? There's times where I create a service & the host doesn't exist. Nagios is kind enough to create a host for me, but it doesn't have any parameters and it's set as inactive. Thus, apply_config fails.
The closest behavior I found from the api is: querying the command_id for the apply_config command. Are these status & event codes with respect to the configs?
{'success': 'Apply config command has been sent to the backend.', 'command_id': 61}
[{'command': '17',
'command_id': '61',
'event_time': '2019-05-30 17:48:17',
'processing_time': None,
'result': None,
'result_code': '0',
'status_code': '0',
'submission_time': '2019-05-30 17:48:17',
'submitter_id': '1'}]
Thanks,
Maxwell Ramirez