Page 1 of 1
Any way to filter certain hosts from appearing in Fusion?
Posted: Wed Apr 24, 2013 3:56 pm
by vAJ
I have to monitor some DEV/QA systems with a NagiosXI instance that mainly monitors production. I'd like to keep the NOC from seeing issues with DEV/QA.
Any way to filter certains hostgroups out of the Fusion OpsCenter dashboard?
Re: Any way to filter certain hosts from appearing in Fusion
Posted: Wed Apr 24, 2013 4:12 pm
by scottwilkerson
At this time there is no way to filter by hostgroup but I believe it is possible to to exclude a list of hosts by modifying the following file
/usr/local/nagiosfusion/html/includes/components/nocscreen/nocfetch.php
around line 192 and line 208 in the noc_get_host_problems_url() & noc_get_service_problems_url() functions, if we add a line to each like:
Code: Select all
$backendargs["host_name"]=nin:HOST1,HOST2;
where HOST1,HOST2 is a comma separated list of your hosts to exclude, it will exclude them from the Fusion OpsCenter dashboard
Re: Any way to filter certain hosts from appearing in Fusion
Posted: Wed Apr 24, 2013 4:19 pm
by vAJ
Possible to use wildcards?
The hosts in question all have the same prefix which is unique to DEV/QA.
Re: Any way to filter certain hosts from appearing in Fusion
Posted: Thu Apr 25, 2013 9:36 am
by abrist
You cannot use wildcards with the component's backend per say, but there are some useful arguments you could use to ignore certain string matches.
From the backend code comments:
Code: Select all
// beginning string match
case "lks":
LIKE
// negative beginning string match
case "nlks":
NOT LIKE
// ending string match
case "lke":
LIKE
// negative ending string match
case "nlke":
NOT LIKE
// mid string match
case "lk":
case "lkm":
LIKE
// negative mid string match
case "nlk":
case "nlkm":
NOT LIKE
// "in" match
case "in":
IN
// negative "in" match
case "nin":
NOT IN
These can be used in php functions to limit results. To give you an example using the backend api passed through the url:
Code: Select all
https://<xi server ip>/nagiosxi/backend/?cmd=gethoststatus&host_name=nlk:DEV,nlk:QA
You would have to alter the php function to use the following backend commands:
Code: Select all
$backendargs["host_name"]=nlk:DEV,nlk:QA
Which would essentially match everything except hosts with hostnames that include "DEV" and "QA" (not-like).
Component Development