[LONG!!!]Nagios+apan on Mandrake9.1 and ... PITA

stefmit stefmit at comcast.net
Wed Jun 11 14:02:17 CEST 2003


Due to some unknown reasons, the "packagers" of Mandrake decided to have 
nagios install all over, with no relationship to where its original docs and 
the defaults seem to indicate. I have - thus - spent an incredible amount of 
hours fixing variables through all possible files, and I finally got stuck 
using apan. Here is the deal: MDK9.1 rpm installs Nagios 1.0 as follows:

usr/sbin/nagios----------> just executable
/etc/nagios/--------------> configuration files (*.cfg)
/usr/lib/nagios/----------> cgi/ --> *.cgi files
		|---------> plugins/------> check_* files
			    	    |-----> contrib/ --> check_*.pl and .sh files
/usr/include/nagios-------> locations.h
/usr/share/nagios/--------> contexthelp/
		  |-------> ssi/
		  |-------> images/ --> *.gif and *.png files
		  |-------> media/
		  |-------> stylesheets/
		  |-------> docs/
		  |-------> index.html, main.html, side.html, robots.txt

I had all of tgeh above taken care of, eventually, thus nagios running, with 
the std plugins ... so I moved on to using apan (I had MRTG for a while, and 
decided to dump it in the favor of this consolidated tool).

As apan does not exist as an rpm, I installed it from the tarball, as follows 
(the closest I came up with, on the new directory structure, based on the 
docs from apan's site, which use as assumed /usr/local/nagios for 
everything):

extract apan from tarball into /usr/share/nagios/ (see above MDK's nagios dir 
structure on why)
cp apan/libexec/* /usr/lib/nagios/plugins/
cp apan/*.cgi /usr/lib/nagios/cgi
extract graph.png from an older version of apan (0.2.1 missed it!)
cp graph.png /usr/share/nagios/images/

fix (because of assumed /usr/local/nagios on all these files) variables in 
/usr/share/nagios/apan/apan.defs (directories, including rrdtool placement)
fix directory where apan.defs is, in the following files:
/usr/share/nagios/apan/apan.sh
/usr/lib/nagios/cgi/apan.cgi
/usr/lib/nagios/cgi/generate.cgi

and - after the creation of the rrd file, using rrdtool, I started filling it 
up with data (I am testing now the simple bandwidth measurement, as described 
here: http://apan.sourceforge.net/ --> documentation --> how to ... for SNMP)

I left debug enabled in apan.defs, for both apan and apancgi, and I can see 
data being entered in the rrd file, when looking at /tmp/apan.debug (NOTE: 
for whatever reasons ... maybe related to my problems - there is no 
apancgi.debug being created?!?)

serviceextinfo is supposed to help in the creation of an icon and link. Here I 
had to follow the new format indicated by nagios docs, vs. the format in apan 
docs, so I ended up with an entry like:

serviceextinfo[my-device;Net-usage]=/nagios/cgi-bin/apan.cgi?host=my-devicer&service=Net-usage;/usr/share/nagios/images/graph.png;View 
graphs

where Net-usage has been defined in /etc/nagios/services.cfg, per the docs.

I am assuming all of the above have been properly defined, as I can see data 
being collected and inserted into the rrd file.

Questions:

1. serviceextinfo (according to apan docs) is supposed to add a link and icon 
... where? I had to download a previous version of apan, just to find 
graph.png (as it is missing from the latest tarball) ... so I fixed that. But 
where are the links supposed to show on the nagios page(s)?

2. when running the script manually, as defined in the serviceextinfo, in 
/etc/nagios/cgi.cfg, i.e.: 
http://localhost/nagios/cgi-bin/apan.cgi?host=my-device&service=Net-usage
all I get are "blank" graphs?!? Any idea why is not reading the file from the 
location I indicated in apan.cfg? The file is there, growing, and is is 
read-writeable by nagios (actually I opened it to the whole world, at one 
point in time, out of frustration ;))

I am in the process of documeting everything, so that I can feed back my 
horrible experience with the way Mandrake packaged this, in regards to where 
all the changes have to go ... so I will (hopefully) be able to "give back" 
to the community pretty soon :)

TIA,
Stef





-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
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