Any way to filter certain hosts from appearing in Fusion?

This support forum board is for questions relating to Nagios Fusion.
Locked
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Any way to filter certain hosts from appearing in Fusion?

Post 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?
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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Any way to filter certain hosts from appearing in Fusion

Post by vAJ »

Possible to use wildcards?

The hosts in question all have the same prefix which is unique to DEV/QA.
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Any way to filter certain hosts from appearing in Fusion

Post 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
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.
Locked