I’ve searched all over, but can’t seem to find a straight answer. Is there anyway to customize the Nagios Web Frontend? We are using Nagios ver. 3. Basically, what I’m trying to accomplish is to simply the tactical view so I can merge it with information from one of our other systems(a proprietary message board) and display it on a big screen in our NOC. I would be happy with removing the 2 boxes at the top labelel: “tactical monitoring overview” and “monitoring performance”. And I’d like to remove the “Monitoring Features” box at the bottom. Again, only for viewing on a large screen in our NOC. I’m open for other suggestions if anyone has any. Just want to see any outages on a big screen, along with updates from our web based message board.
I’m about to do something very similar. I intend to write a CGI script that does a wget on 127.0.0.1/nagios/cgi-bin/tac.cgi as an input to an array, outputs some standard HTML CGI header (adding autorefresh, referencing the nagios style-sheets etc as appropriate), then parses the array line by line, outputting only the tables I wan’t to display. I may have to muck about with it a bit more or use a custom style-sheet to change the colours to something more “corporate”, but if you’re happy with all that then I think you could pretty much start with a basic line count on the array and ‘ignore’ the lines for those top 2 tables (i.e. just don’t output any lines until after, say, line 75) as those really shouldn’t change, and then after that output everything that doesn’t match the 'Monotoring Features" line - when you hit that, stop outputting content from the array, close the (now empty) Monitoring features table, and close off the page. After parking the script in /usr/local/nagios/sbin/ and a quick bit of chown and chmod, I envisage the thing to work as advertised…
Ok… so not as simple as I 1st suspected, as I had to resport to using the LWP agent, but once I got my head round that, happy days. This is the script if anyone’s interested…
Looks good. I’m trying it now. What is LWP? I don’t believe I have that installed, because it’s giving me an error. Excuse my ignorance, I’m more of a networking guy than a programming guy! I also would assume, I could call this script from a web browser, if I thru this in the nagios cgi-bin directory?
In a nutshell, LWP is a set of perl modules that provide an API to the web (you can find much more on it here - I thought it was a generic perl module, but I could be wrong in which case it shouldn’t be too hard to get hold of, infact you can download a version of it from CPAN via that previous link).
You should just be able to place the script in the same directory as tac.cgi (/usr/local/nagios/sbin on my server), call it something like tac2.cgi, then do…
chown nagios:nagios tac2.cgi
chmod 775 tac2.cgi
…so it matches the permissions of tac.cgi. Once that’s done, you should be able to call it up on your web-browser. If you’re not sure of the url straight off, just open the original tactical overview page in a new window and change the url to tac2.cgi.
Oh, and make sure you change the following to accurately reflect the location of your perl executable and your nagios username and password
That worked perfect! Exactly what I was looking for, Thanks!! the only problem is I still have to enter a username/password, but I can live with that. And I did edit the portion of your script and put my username/password in there.
Splendid. Feel free to move it to somewhere else on your server, but you’ll probably need to change the relative link to the stylesheet. Oh, and I realised earlier I forgot to include the autorefresh :roll: . If you didn’t spot it was missing and haven’t fixed it yourself already, you need to put: