I'm trying to pull the custom variables created for particular host and service monitors. Would any one be able to provide the column to link the custom variable with the associated service or host? Following is what I have so far:
SELECT nagios_hosts.alias as HostName, nagios_customvariables.varname, nagios_customvariables.varvalue, nagios_customvariables.object_id
from nagios_hosts, nagios_customvariables
WHERE nagios_hosts.alias like 'Hostname%'
and nagios_customvariables.instance_id = nagios_hosts.instance_id
ORDER BY HostName ASC;
Thanks,
Marcus
Query to Display Custom Variable Values
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Query to Display Custom Variable Values
These are available as backend API calls
getcustomhostvariablestatus
getcustomservicevariablestatus
However, to answer your question
that does look correct provided you are doing the match on alias and you are replacing
like 'Hostname%'
with the begining of the host alias you are trying to match
getcustomhostvariablestatus
getcustomservicevariablestatus
However, to answer your question
that does look correct provided you are doing the match on alias and you are replacing
like 'Hostname%'
with the begining of the host alias you are trying to match