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?
Any way to filter certain hosts from appearing in Fusion?
Any way to filter certain hosts from appearing in Fusion?
Andrew J. - Do you even grok?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Any way to filter certain hosts from appearing in Fusion
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:
where HOST1,HOST2 is a comma separated list of your hosts to exclude, it will exclude them from the Fusion OpsCenter dashboard
/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;Re: Any way to filter certain hosts from appearing in Fusion
Possible to use wildcards?
The hosts in question all have the same prefix which is unique to DEV/QA.
The hosts in question all have the same prefix which is unique to DEV/QA.
Andrew J. - Do you even grok?
Re: Any way to filter certain hosts from appearing in Fusion
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:
These can be used in php functions to limit results. To give you an example using the backend api passed through the url:
You would have to alter the php function to use the following backend commands:
Which would essentially match everything except hosts with hostnames that include "DEV" and "QA" (not-like).
Component Development
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 INCode: Select all
https://<xi server ip>/nagiosxi/backend/?cmd=gethoststatus&host_name=nlk:DEV,nlk:QACode: Select all
$backendargs["host_name"]=nlk:DEV,nlk:QAComponent Development
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.