More meaningful Nagios Map(s)

Geoffrey Walton geoffrey.walton at midwich.com
Tue Sep 26 22:49:55 CEST 2006


Here is something I did when trying to improve the user defined
 status map



Nagios 2.5

Redhat EL4



Setting Up Your Status Map



On your host server go to http://www.nagiosexchange.org/Image_Packs.75.0.
html?&tx_netnagext_pi1[p_view]=107 and download inmagepak_cook.tar.gz.





Put the contents in /usr/local/nagios/share/images/logos.





>From http://www.nagiosexchange.org/Frontends.37.0.html?&tx_netnagext_pi1[
p_view]=166 download nagiosmap.pl to your desktop.



If you can see it or the program will not run 



chmod 744 ~/Desktop/nagiosmap.pl



The current download (12/9/2004) will work if you edit the code
 slightly as the entries in hostextinfo.cfg file and the location
 of directories have changed in this release.





So open nagiosmap.pl in an editor and on line 36 & 52 ...



my $imgpath="/usr/local/nagios/share/images/logos/";



my $cfgpath="/usr/local/share/nagios/etc/";



Replace gd2_image with statusmap_image in 2 places e.g.





print SAVE " gd2_image ".$object{$obj}{"GD2"}."\n";



print SAVE " statusmap_image ".$object{$obj}{"GD2"}."\n";



} elsif ($line =~ /^\s+statusmap_image\s+([\w\d\-\_\.]+)\s*(\;?.*|)$/)
 {



If you are really picky you could also change Enable to Unable in
 all the error messages.



There does seem to be some work being done at http://cvs.orion.education.
fr/viewcvs/racvision/src/nagiosmap/ .



apt-get install perl-Tk



apt-get install perl-Locale-gettext



Now you can run the script. (You might need to get some other perl
 modules but I am sure the erro messages witll be extremly clear
 and easy to decipher :-)



~/Desktop/nagiosmap.pl



Click on File and Open, open and open.



There are no lines on the map because the hosts file does not have
 any parent info. But once you put a hub in your hosts.cfg you can
 put a parent line in the definitions for your servers and then
 you start to get a "map".



So exit the program and update your hosts.cfg.



When you restart the program you can drag and drop the images.



Assign an image to every host by right clicking on the questionmarks
 and selecting from the drop down.



File, save,save,Yes,Yes



Go and look at the hostextinfo.cfg file it created for you. The
 fields it can contain are shown below.



define hostextinfo{

host_name host_name

notes note_string

notes_url url

action_url url

icon_image image_file

icon_image_alt alt_string

vrml_image image_file

statusmap_image image_file

2d_coords x_coord,y_coord

3d_coords x_coord,y_coord,z_coord

}



You can use and editor to add default entries for lines it does
 not put in.



Validate your config files and restart nagios.



Select Status Map from the menubar on the left and then User Supplied
 Co-ordinates and click on update.



Enjoy 



Geoffrey



-----------------------

This thread is located in the archive at this URL:

http://www.nagiosexchange.org/nagios-users.34.0.html?&tx_maillisttofaq_pi
1[showUid]=21918

					

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list