Nagiostat


#1

Hi,

I’m trying to create some performance graphs but when i look in the debug.log file from nagiostat I get the folowing.

**INCOMING PERFDATA:
LASTCHECK=$
HOSTNAME=FSLYL
SERVICEDESCR=“PING"
SERVICESTATE=“OK"
OUTPUT=”$“
PERFDATA=”$”
**WARNING: Hostname and description didn’t match any of the regexes in the config-file.

My misccommands.cfg contains:
define command{
command_name process-service-perfdata
command_line /usr/local/nagios/nagiostat -p "$LASTCHECK$|!!|$HOSTNAME$|!!|$SERVICEDESC$|!!|$SERVICESTATE$|!!|$OUTPUT$|!!|$PERFDATA$
}

Any id why the other variables aren’t filled in the debug.log file ?

Nagios is v2.0rc2

Rene


#2

you are using nagios1.x macros

use SERVICEOUTPUT, LASTSERVICECHECK and SERVICEPERFDATA.

Luca


#3

Thanks luca,

The correct data is now filled in and a file is created in nagiostat/archives.
But whenever I go from nagios and try to see the graph I get:
"You don’t have permission to access /nagiostat/nagiostat.cgi on this server. "
Looking in the apache log I get:
“Symbolic link not allowed”

Nagios runs under user nagios and is member of nagcmd.
Apache runs under user wwwrun and is member of nagcmd.

-rwxrwxr-x 1 nagios nagcmd 19705 Jul 6 2004 nagiostat
lrwxrwxrwx 1 nagios nagcmd 9 Jan 18 13:05 nagiostat.cgi -> nagiostat

Whenever I do su nagios or su wwwrun in a shell, I can run nagiostat.cgi

Can you also tell me where I can find some info and examples about nagiostat.conf.

Regards,

Rene

Edited Wed Jan 18 2006, 03:34PM ]


#4

What are the permissions on the nagiostat directory?

the nagiostat.conf file is quite self explanatory. most diffiuclt part for me were the regexes which i had never done at that time… :smiley: for the ping/RTA values you just ned to chenga ethe hostnames in the example file and you should get something usable.

Luca


#5

Luca,

The rights for the directory is as follow:

drwxr-xr-x 9 nagios nagcmd 224 Jan 18 13:07 .
drwxr-xr-x 14 root root 360 Jan 17 12:06 …
drwxrwxr-x 2 nagios nagcmd 104 Jan 18 11:24 bin
drwxrwxr-x 3 nagios nagcmd 368 Jan 13 16:28 etc
drwxr-xr-x 2 nagios nagcmd 1648 Jan 13 13:28 libexec
drwxr-xr-x 5 nagios nagcmd 400 Jan 19 09:04 nagiostat
drwxrwxr-x 2 nagios nagcmd 552 Jan 18 11:24 sbin
drwxrwxr-x 9 nagios nagcmd 360 Jan 18 11:24 share
drwxrwxr-x 4 nagios nagcmd 432 Jan 19 11:41 var

Rene


#6

do you have the Options line in the apache conf file for your nagios host? looks like apache is blocking the FollowSymLinks option…

it should read

Options +ExecCGI

Luca


#7

Luca,

Hereby my apache conf files.
Within nagios all cgi scripts are working.

cat nagios.conf
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
<Directory “/usr/local/nagios/sbin”>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

Alias /nagios /usr/local/nagios/share
<Directory “/usr/local/nagios/share”>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

cat nagiostat.conf
Alias /nagiostat/ /usr/local/nagios/nagiostat/
<Directory “/usr/local/nagios/nagiostat”>
Options +ExecCGI
Order allow,deny
Allow from all

Rene


#8

Alias /nagiostat /usr/local/nagiostat/
<Directory /usr/local/nagiostat>
Options +ExecCGI
AddHandler cgi-script .cgi
Order allow,deny
Allow from all

this is what i have…
the line “AddHandler cgi-script .cgi” is missing in your config but i don’t think it’s this…

not sure what else could be wrong…

Luca


#9

Added the line:
"AddHandler cgi-script .cgi"
But the result is the same.
"You don’t have permission to access /nagiostat/nagiostat.cgi on this server. "
Looking in the apache log I get:
“Symbolic link not allowed”

Rene


#10

try adding explicitly the symbolic links option…

Options +ExecCGI +FollowSymLinks
not sure if the + has to be on every parameter or not…

Luca


#11

Luca,

That seems to do it.
message now is Graph doesnot exists.

I call nagiostat as follow:
/nagiostat/nagiostat.cgi?graph_name=fs_lyl-ping

Rene
Edited Wed Jan 18 2006, 10:00PM ]


#12

good. :slight_smile: Now you have to edit nagiostat.conf.
read the comments and you should find all you need to get at least a ping graph running :slight_smile:

Luca