Nagiostat on freebsd - getting a 403 error (forbidden)



I believe I’ve got nagiostat set up almost correctly, but I keep getting a 403 error (forbidden) when I click on the icon to display the graphs.

From what I can tell the rrd file is being generated, and I’m not seeing errors in the debug.log file, so I’ll assume this is just a permissions or path issue.

I’ve tried every combination I can think of, and I’m sure I’m just missing something so easy I completely missed it. I’ve pasted the sections of the files that I think are the culprit. I hope one of you has better eyes than I do! Don’t forget this is on FreeBSD 7.

– nagiostat.conf –
-rwxr–r-- 1 root wheel 11396 Aug 7 01:15 nagiostat.conf

Pointer to where the rrd-tool binary is located

RRDToolPath /usr/local/bin/rrdtool

Pointer to where HTML-templates are stored

HTMLTemplatePath /usr/local/libexec/nagiostat/html-templates

Pointer to HTML-template for the index-page (relative to HTMLTemplatePath)

GraphIndexTemplate graphindex.html

Pointer to directory where the RRD-archive-files are stored

nagiostat automatically creates RRD-archives if they dont exist.

IMPORTANT: the whole directory RRDArchivePath must be writable by the nagios user (that calls the


RRDArchivePath /var/spool/nagios/nagiostatrrd

– httpd.conf –
-rw-r–r-- 1 root wheel 17144 Aug 7 21:37 httpd.conf

User www
Group www

<Directory /usr/local/libexec/nagiostat>
AllowOverride AuthConfig
AddHandler cgi-script cgi pl
Options +ExecCGI
Order allow,deny
Allow from all

ScriptAlias /nagiostat/ /usr/local/www/nagios/cgi-bin/

– RRDArvhivePath –
drwxrw-r-- 2 nagios nagios 512 Aug 6 23:50 nagiostatrrd

– nagiostat –
drwxr-xr-x 2 root wheel 512 Jul 29 18:10 html-templates
-rwxrwxrwx 1 root wheel 19774 Aug 7 20:33 nagiostat

lrwxr-xr-x 1 root wheel 38 Jul 29 18:10 nagiostat.cgi -> /usr/local/libexec/nagiostat/nagiostat

Any help would be much appreciated!



I forgot to include the notes_url, so here it is:

notes_url /nagiostat/nagiostat.cgi?graph_name=borg-ping



SO I got it half working.

If I point the browser to the location of nagiostat.cgi (which is a symlink in /nagios/cgi-bin that point to the nagiostat script), I get the 403 error.

If I point the browser directly to the nagiostat script and remove the “.cgi” extension, it works!

It now appears to be just a symlink issue of some sort.

e.g. this does NOT work … =borg-ping

e.g. this DOES work … =borg-ping

I added the “FollowSymLinks” option to httpd.conf under the /usr/local/www/nagios directory (this = the /nagios/ alias) but that doesn’t fix things.

What am I still missing:?:!



HA! Got it.

I forgot to check the <Directory /usr/local/www/nagios/cgi-bin> section that was in a different part of the config file. It didn’t have the FollowSymLinks directive, so I added it. It also needed the AllowOverride AuthConfig directive.

Hopefully this will help someone else in the future, even though it should be been self-evident to me from the beginning!

<Directory /usr/local/www/nagios/cgi-bin>
Options +FollowSymLinks +ExecCGI
AllowOverride AuthConfig