Monday, April 8, 2013

Adding ICONS to Nagios Map

Adding ICONS to Nagios Map

By default the Nagios map looks confusing, having question marks everywhere doesn’t help. as an administrator you should be able to just look at the map and automatically know whats happening. icons can make things easier to understand. by default Nagios comes with some icons and they can do the trick but they are not all that appealing to the eye, so i made my own. the default icon set can be found in:
/usr/local/nagios/share/images/icons/

The Cloud is for internet sources, the server is ESXi physical hosts, the penguin is for Linux servers, printer for printers, the next one is a router then switch and then a windows server.
The icons must be 40 X 40 pixels as this is what Nagios uses
Because I am using putty with an SSH connection to my server, I can use PSFTP to put the images on to the server, PSFTP is a free FTP client that comes with putty. this will upload the icons to the Nagios server.
Open PSFTP
Type:
open 172.30.3.237 (this is the IP address of the Nagios server)
enter username and password as requested.
type:
put
Then in widows explore find the file you want to transfer and drag and drop into the CLI
Once this is done move the .png images into the appropriate file location within the Nagios install
/usr/local/nagios/share/images/logos/
Once this is done the image needs to be converted to GD2 file format as a part of my install I installed the pngtogd2 converter.
pngtogd2 /usr/local/nagios/share/images/logos/Windows.png /usr/local/nagios/share/images/logos/WindowsServer.gd2 0 1
Nagios uses the gd2 image for its status maps and the png image everywhere else.
To add the images to the map, in each Template file that was made two lines need to be added
nano /usr/local/nagios/etc/objects/Switch_EI.cfg

define host{
name                         ESXi-server
use                             generic-host
check_period          24×7
check_interval        5
retry_interval         1
 max_check_attempts               10
check_command                            check-host-alive
 notification_period                        24×7
 notification_interval                      30
           notification_options                       d,u,r
           contact_groups                               admins
           hostgroups                                         switches
           register                                                 0
           icon_image                                         switch.png
           statusmap_image                            switch.gd2
        }

Add those two lines on each of the template files with the appropriate icons and all of the icons should appear. then the map is much easier to see whats going on.

No comments:

Post a Comment

Cara Mengubah DNS ke DNS Tercepat di Android (Wifi dan Data)

Halo Teman-teman, Kembali lagi di channel saya danijuntak, Di video ini saya akan menjelaskan fungsi DNS di android dan kenapa harus mengg...