Statusmap icons missed!

Hi all,

I’m a NAGIOS newbie. NAGIOS is succesfully running on my box, but I have several problems concerning the statusmap.

First, I’m not able to make appear icon images altought I followed all forum advices (gd2 images, not more than 40x40 pixels, placed in /usr/local/nagios/share/images/logos as ther rest of images)

Here I paste one of my cfg map file, so if you find any mistake please make me know. Maybe the

###############################

Host Map #1:

###############################

Generic Definitions:

define hostextinfo{
name cliente-linux

icon_image linux.png

    statusmap_image linux.gd2
    register        0
    }

define hostextinfo{
name cliente-windows

icon_image windows.png

    statusmap_image windows.gd2
    register        0
    }

###########################

Particular Definitions:

define hostextinfo{
use cliente-linux
host_name aleph
2d_coords 40,60
}

define hostextinfo{
use cliente-linux
host_name metal
2d_coords 40,100
}

define hostextinfo{
use cliente-linux
host_name trance
2d_coords 40,140
}

define hostextinfo{
use cliente-linux
host_name yoyas
2d_coords 80,100
}

define hostextinfo{
use cliente-linux
host_name guu
2d_coords 240,60
}
2d_coords 40,100
}

define hostextinfo{
use cliente-linux
host_name trance
2d_coords 40,140
}

define hostextinfo{
use cliente-linux
host_name yoyas
2d_coords 80,100
}

define hostextinfo{
use cliente-linux
host_name guu
2d_coords 240,60
}
define hostextinfo{
use cliente-windows
host_name ioda
2d_coords 180,100
}

define hostextinfo{
use cliente-linux
host_name elvira
2d_coords 340,100
}

Second, an easier question :slight_smile: : Everytime that I modify any given conf file, I reload NAGIOS but changes are not applied. Why does it occur?

Sorry if some of those questions is ridiculous, but as I said above I’m a very beginner!

Thanls for the thousand of replies

try using png org gif images… maybe they work :slight_smile:

possibly you have more than one instance of nagios running.
stop nagios.
ps -ef | grep nagios
kill all ramiaing nagios processes and then resatrt nagios and see if your modifications are now online :slight_smile:

Luca

Thanks! Any other idea? Unfortunately I tried those options (png & gif), but it didn’t succeed

Need to got to nagios.cfg to enable Nagios to read the file where this is define. (Not define by default)

Extended host/service info definitions are now stored along with

other object definitions:

cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
#cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg

As u see the # is remove at “cfg_file=/usr/local/nagios/etc/hostextinfo.cfg”

Actually it doesnt matter where u place the commands, u can even place them in services.cfg for all the program cares. It only reads the commands from the file where its define to be checked. The *.cfg are just are tidiness and easier catergorizing of the commands for the administrator.

Hi edyim, thanks for your answer but it doesn’t work. I’m really worried as I can’t even see the “?” in the Status Map!!

Any other option?

I get the idea that your statusmap.cgi is not compiled correctly.
Do this please and paste your output here:
cd /usr/local/nagios/sbin
ldd statusmap.cgi

What did you get? Paste it here. I bet you are getting some ??? missing files.

Thanks jakkedup. Here is the output. Is anything wrong?
cd /usr/local/nagios/sbin
ldd statusmap.cgi

           libgd.so.1 => /usr/lib/libgd.so.1 (0x4001b000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0x4004d000)
    libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40073000)
    libz.so.1 => /usr/lib/libz.so.1 (0x40091000)
    libm.so.6 => /lib/tls/libm.so.6 (0x400a3000)
    libc.so.6 => /lib/tls/libc.so.6 (0x400c5000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x401fa000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

kenny:/usr/local/nagios/sbin#

That looks fine and says that it can find all libs for that .cgi

This is what I have in my hostextinfo.cfg

define hostextinfo {
host_name HR-RF-Wavespan-2
icon_image modem.gif
gd2_image modem.gd2
2d_coords 4455,425
}

So instead of you using the definition of:
statusmap_image linux.gd2
make it
gd2_image linux.gd2

[quote=“edyim”]Need to got to nagios.cfg to enable Nagios to read the file where this is define. (Not define by default)

Extended host/service info definitions are now stored along with

other object definitions:

cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
#cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg

As u see the # is remove at “cfg_file=/usr/local/nagios/etc/hostextinfo.cfg”

Actually it doesnt matter where u place the commands, u can even place them in services.cfg for all the program cares. It only reads the commands from the file where its define to be checked. The *.cfg are just are tidiness and easier catergorizing of the commands for the administrator.[/quote]

I don’t see that there is a definition in the nagios.cfg for cfg_file=/usr/local/nagios/etc/hostextinfo.cfg so I don’t think that is correct.

The proper place is in cgi.cfg and the definition is:
xedtemplate_config_file=/usr/local/nagios/etc/hostextinfo.cfg
xedtemplate_config_file=/usr/local/nagios/etc/serviceextinfo.cfg

So, if you have defined it in nagios.cfg then please remove it. Define it in cgi.cfg instead like above.

nagios.sourceforge.net/docs/1_0/xedtemplate.html

Edited Mon Aug 08 2005, 04:11AM ]

This is from the hostextinfo-sample.cfg file

This definition is used as a template

define hostextinfo{
name hei1 ; This name is referenced in other hostextinfo definitions that
; want to use this as a template
icon_image novell40.gif
icon_image_alt IntranetWare 4.11
vrml_image novell40.gif
gd2_image novell40.gd2
register 0 ; DO NOT REGISTER THIS DEFINITION - IT IS JUST A TEMPLATE!!
}

But yet the docs say this:
statusmap_image image_file

So there appears to be a problem with the docs.

Once you have fixed your nagios.cfg and cgi.cfg files, restart nagios. After that, any changes you make in hostextinfo.cfg will show up as soon as you clik on the links in the website. You dont have to restart nagios after a change in the extinfo files.

To sum up,

  • cgi.cfg -> xedtemplates_config_file=/usr/local/nagios/etc/hostextinfo.cfg

  • nagios.cfg -> cfg_file=/usr/local/nagios/etc/hostextinfo.cfg

  • Images .gd2 located in -> /usr/local/nagios/share/images/logos

  • In my hostextinfo.cfg ->

define hostextinfo{
name cliente-linux
icon_image linux.png
gd2_image linux.gd2
register 0
}

define hostextinfo{
name cliente-windows
icon_image windows.png
gd2_image windows.gd2
register 0
}

… it doesn’t work… :evil:

Edited Mon Aug 08 2005, 04:34AM ]

permission problem maybe. Look at your apache error log. It may say something like image not found.

cd /usr/local/nagios
[root@tia3407 nagios]# ls -la
total 72
drwxrwxr-x 9 nagios nagios 4096 Jun 27 13:27 .
drwxr-xr-x 22 root root 4096 Aug 1 15:54 …
drwxrwxr-x 2 nagios nagios 4096 Jul 24 15:55 bin
drwxrwxr-x 2 nagios nagios 4096 Aug 7 12:04 etc
drwxr-xr-x 2 nagios nagios 4096 Aug 1 14:53 libexec
drwxr-xr-x 4 nagios nagios 4096 Jun 27 13:26 nagiostat
drwxrwxr-x 2 nagios nagios 4096 Jul 24 15:55 sbin
drwxrwxr-x 9 nagios nagios 4096 Jul 24 15:55 share
drwxrwxr-x 4 nagios nagios 4096 Aug 8 00:00 var

cd share
[root@tia3407 share]# ls -la
total 104
drwxrwxr-x 9 nagios nagios 4096 Jul 24 15:55 .
drwxrwxr-x 9 nagios nagios 4096 Jun 27 13:27 …
drwxrwxr-x 2 nagios nagios 4096 Jul 24 15:55 contexthelp
drwxrwxr-x 3 nagios nagios 4096 Jul 24 15:55 docs
-rw-r–r-- 1 nagios nagios 110 Jun 5 14:07 .htaccess
drwxrwxr-x 3 nagios nagios 4096 Jul 24 15:55 images
-rw-rw-r-- 1 nagios nagios 658 Jul 24 15:55 index.html
drwxr-xr-x 4 nagios nagios 4096 Jun 6 17:52 locale
-rw-rw-r-- 1 nagios nagios 2342 Jul 24 15:55 main.html
drwxrwxr-x 2 nagios nagios 4096 Jul 24 15:55 media
-rw-rw-r-- 1 nagios nagios 26 Jul 24 15:55 robots.txt
-rw-rw-r-- 1 nagios nagios 10512 Jul 24 15:55 side.html
drwxrwxr-x 2 nagios nagios 4096 Jun 5 13:33 ssi
drwxrwxr-x 2 nagios nagios 4096 Jul 24 15:55 stylesheets

Images and logos should be something like this
-rw-rw-r-- 1 nagios nagios 891 Jul 24 15:55 ack.gif

or in logos I have this:
-rw-rw-rw- 1 nagios nagios 176423 Jun 14 2004 3ComSS2h500.gd2

I thought about that, so I modified every permission to 777 :evil: but it didn’t work. Now I have those permissions, exactly as yours:

kenny:/usr/local/nagios# ls -la
total 32
drwxrwsr-x 8 nagios www-data 4096 2005-05-09 17:07 .
drwxrwsr-x 10 root staff 4096 2005-05-19 14:34 …
drwxrwxr-x 2 nagios www-data 4096 2005-04-26 17:20 bin
drwxrwxr-x 6 nagios www-data 4096 2005-08-08 14:22 etc
drwxr-sr-x 2 nagios www-data 4096 2005-05-20 12:21 libexec
drwxrwxr-x 2 nagios www-data 4096 2005-04-26 17:20 sbin
drwxrwxr-x 9 nagios www-data 4096 2005-05-20 11:52 share
drwxrwxr-x 4 nagios www-data 4096 2005-08-09 08:28 var

kenny:/usr/local/nagios# cd share
kenny:/usr/local/nagios/share# ls -la
total 68
drwxrwxr-x 9 nagios www-data 4096 2005-05-20 11:52 .
drwxrwsr-x 8 nagios www-data 4096 2005-05-09 17:07 …
drwxrwxr-x 2 nagios www-data 4096 2005-04-26 17:20 contexthelp
drwxrwxr-x 3 nagios www-data 4096 2005-04-26 17:20 docs
-rw-r–r-- 1 nagios www-data 111 2005-04-22 14:42 .htaccess
drwxrwxr-x 3 nagios www-data 4096 2005-04-27 17:09 images
-rw-rw-r-- 1 nagios www-data 658 2005-04-26 17:20 index.html
drwxr-sr-x 4 nagios www-data 4096 2005-04-22 12:20 locale
-rw-rw-r-- 1 nagios www-data 2341 2005-04-26 17:20 main.html
drwxrwxr-x 2 nagios www-data 4096 2005-04-26 17:20 media
-rw-rw-r-- 1 nagios www-data 26 2005-04-26 17:20 robots.txt
-rw-rw-r-- 1 nagios www-data 12729 2005-04-26 17:20 side.html
drwxrwxr-x 2 nagios www-data 4096 2005-04-22 12:14 ssi
drwxrwxr-x 2 nagios www-data 4096 2005-04-26 17:20 stylesheets

kenny:/usr/local/nagios/share/images# cd logos
kenny:/usr/local/nagios/share/images/logos# ls -la
total 84
drwxrwxr-x 2 nagios www-data 4096 2005-05-09 17:15 .
drwxrwxr-x 3 nagios www-data 4096 2005-04-27 17:09 …
-rw-rw-rw- 1 nagios www-data 6575 2005-05-09 17:07 linux.gd2
-rw-r–r-- 1 nagios www-data 2081 2005-04-27 16:06 linux.png
-rw-rw-rw- 1 nagios www-data 2389 2005-04-26 17:20 nagios.gd2
-rw-rw-r-- 1 nagios www-data 1224 2005-04-26 17:20 nagios.gif
-rw-rw-r-- 1 nagios www-data 21699 2005-04-26 17:20 nagiosvrml.png
-rw-rw-rw- 1 nagios www-data 2607 2005-04-27 17:06 switch1.gd2
-rw-r–r-- 1 nagios www-data 399 2005-04-27 16:39 switch1.png
-rw-rw-rw- 1 nagios www-data 2648 2005-04-27 17:07 switch2.gd2
-rw-r–r-- 1 nagios www-data 387 2005-04-27 16:40 switch2.png
-rw-rw-rw- 1 nagios www-data 2389 2005-04-26 17:20 unknown.gd2
-rw-rw-r-- 1 nagios www-data 1280 2005-04-26 17:20 unknown.gif
-rw-rw-rw- 1 nagios www-data 1817 2005-05-09 17:15 windows.gd2
-rw-r–r-- 1 nagios www-data 1047 2005-04-27 16:54 windows.png

images are correct too, but I even can’t see “?” in my status map… Why don’t we call Mulder & Scully??

are you getting anything in the apache logs?

Luca

Nothing extrange…

post a small pic of your map.
Here is my pic after I intentionally broke it with a chmod of the pic files.

ls -la unk*
-rw-rw-r-- 1 nagios nagios 2389 Jul 24 15:55 unknown.gd2
-rw-rw-r-- 1 nagios nagios 1280 Jul 24 15:55 unknown.gif
[root@tia3407 logos]# chmod 660 unknown*
[root@tia3407 logos]# ls -la unk*
-rw-rw---- 1 nagios nagios 2389 Jul 24 15:55 unknown.gd2
-rw-rw---- 1 nagios nagios 1280 Jul 24 15:55 unknown.gif


What do you get when you go to:
localhost/nagios/images/logos/unknown.gif

If you get nothing, then please don’t tell me you have nothing in the apache error logs, because you must have something like

“Permission denied: file permissions deny server access: /usr/local/nagios/share/images/logos/unknown.gif”

Or “File does not exist: /usr/local/nagios/share/images/logos/unknown.gif”

localhost/nagios/images/logos/windows.gd2

What do you get?

My StatusMap is exactly as your picture. However, once I put

localhost/nagios/images/logos/unknown.gif

“?” is shown without problem. Same for all png and gif pics (gd2 is not supported by Mozilla, but errors or permission denied messages are not shown)

What apache log file do you want me to post?

Thanks again and again

OK, then it must be that you didn’t compile nagios to use Template-based Extended info data.

Paste the ./configure line that you used to compile nagios.
You can find that info in your nagios src directory where you compiled nagios in the file config.status.

If you don’t have the source and don’t remember how you compiled nagios, then do it again and compile nagios to use Template-based ext info.