Status Map Include/Exclude Doesn't Fully Work

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
chrisp
Posts: 71
Joined: Fri Dec 28, 2012 11:35 am

Status Map Include/Exclude Doesn't Fully Work

Post by chrisp »

Hi All,

When I try to get a simpler view of our network of hosts by including only a particular hostgroup in the '/nagios/cgi-bin/statusmap.cgi' the excluded hosts are removed from the map, but their positions within the network remain, so not actually excluding them properly at all & making the operation useless for the intended use (simplifying my view).

These screenshots should explain better than I can with just words...

Unfiltered (WAY too cluttered): -
Network Map - A Bit Cluttered.png
Network Map - A Bit Cluttered.png (16.69 KiB) Viewed 1038 times
Filtered (no practical difference - useless): -
Network Map - No Bloody Better.png
Is there something I can do about this?

I know it'll look better when I have all our parent->child relationships set up, and that's exactly what I'm trying to sort out, hoping that the filtering would help me see more clearly.

I've tried applying the patch from here: http://exchange.nagios.org/directory/Pa ... E3/details which did make it a bit more colourful, but no improvements to the include/exclude functionality.

The patch from here doesn't apply at all (wrong version) http://ten-fingers-and-a-brain.com/2011 ... statusmap/

I'm out of ideas :(

Cheers,
--
ChrisP
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Status Map Include/Exclude Doesn't Fully Work

Post by abrist »

Unfortunately, this seems to be the case, as "exclude" just removes the object circle and text from the map. This may be working as intended, but if you wish, you could file a bug on the tracker: http://tracker.nagios.org
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.
User avatar
chrisp
Posts: 71
Joined: Fri Dec 28, 2012 11:35 am

Re: Status Map Include/Exclude Doesn't Fully Work

Post by chrisp »

OK, well it's definitely not the way I intend it to work! So I figured that because I'm not too bad at this sort of thing (tweaking rather than actually creating code) and none of my more qualified colleagues had helped me (the swines), I'd have a go at porting the older patch I mentioned, to the version I'm using.

I did it :) There were 2 sections which I couldn't quite get my head around, so I inserted the potential patches as comments, hoping that someone might tell me they-re not needed (likely) or how to best apply them (if needed at all).

The change in include/exclude functionality that I had intended, seems to have worked exactly as I'd hoped. However, while I was testing this, I noticed that because there's an automatic refresh in place, that, combined with the fact that the cgi script uses "POST" rather than "GET", the page gets reset to the default view (which is a blank URL), every <refresh_rate> seconds - annoying. I altered the method to "GET" & this is no longer a problem.

I've attached a diff between the original statusmap.c from Nagios Core v3.5.0 & my current one, which includes the patches from: http://exchange.nagios.org/directory/Pa ... E3/details and now most of the patches from: http://ten-fingers-and-a-brain.com/2011 ... statusmap/ - I hope I've done it right and that it's useful to others.

Cheers,
--
ChrisP
Attachments
statusmap.c.patch.txt
Status Map Patch - Fancy Colours & Include/Exclude Lovliness
(21.48 KiB) Downloaded 97 times
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Status Map Include/Exclude Doesn't Fully Work

Post by sreinhardt »

Awesome! I would highly suggest posting this as an issue on the tracker, as abrist mentioned. Especially since you can include a sweet patch, it should get pushed through rather quickly!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked