Log or database entry for host changing host group?
-
peter.zanetti
- Posts: 90
- Joined: Wed Oct 01, 2014 8:34 am
Log or database entry for host changing host group?
We frequently have hosts that change host groups to receive different types of monitoring, is there anywhere we can see when a host was moved from one host group to another?
Re: Log or database entry for host changing host group?
If I remove the host "alice" from the hostgroup "mediocre-servers" and add it to the hostgroup "cool-servers", the following entry is added to nagiosxi.xi_auditlog.message:
So not exactly as specific as you would like.
You could probably do this on a cron job by querying the nagiosql.tbl_host table and storing the entries id, host_name, and hostgroups fields and using them as a reference for the next time the cron job gets run. Some pseudocode:
Code: Select all
Host modified: aliceYou could probably do this on a cron job by querying the nagiosql.tbl_host table and storing the entries id, host_name, and hostgroups fields and using them as a reference for the next time the cron job gets run. Some pseudocode:
Code: Select all
$old = previous query result;
$current = SELECT id, host_name, hostgroups FROM nagiosql.tbl_host;
if(!($old.hostgroups == $current.hostgroups)) {
//changes were made, figure them out and report to a file
}
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/