I've created a template for monitoring AIX Servers via NMON. It monitors many different aspects of an AIX Server including:
- CPU (cumulative and per CPU statistics)
- Memory (distribution and stats)
- Disk (Busy [%] and Read/Write Rate)
- IO Adapter Statistics (Read/Write Rate)
- JFS Statistics (Used Inode and Filespace)
- Net Statistics (Traffic In/Out)
- Page Statistics (Page In/Out/Faults)
- The existing interfaces/devices are read out dynamically via data-queries.
- The results are cached locally on the nagios server. Graphing more than one item does not result in multiple ssh-connects to the AIX Box.
- The NMON Binary is choosed automatically depending on the OS Version it runs on.
- There are 2 ways for getting the data via nmon:
the plugin connects via ssh and run nmon every time (resource consuming)
run nmon via crontab once per day and write results in a file. The Plugin gets some parts of this file for creating the graphs.
- There are variables for nearly all parameters, but some parameters have to be specified manually (replaced) in the script(s).
- It would be good to have a central configfile and not to specify the same things in every .pl file.
- copy the scripts and resources in their corresponding directories
- Generate a public/private keypair for your cacti poller user and save it somewhere. There are many tutorials on the net and also in this forum how to do it. Test if the cacti-poller-user can login the the aix-boxes without needing a password. Also check that the user on the aix box can read the nmon-file and/or execute the nmon binary.
- adjust the parameters in the .pl files.
- nmondir: the directory where the nmon-binaries are stored on the aix-box. The plugin will take care of executing the right one for your system.
- cachedir: the directory (on cacti server) where the data should be cached
- ssh_idfile: the ssh identity file for connecting to the aix servers
- nmon_runmode: in some scripts you can find this variable. you can specify here how the data is gathered from aix server (via crontab or directly executed). If the variable does not exist, simply create it. The default is to run as "daemon". The opposite is to run as "user".
- adjust the ssh-user in query_nmon.pm
I have not yet created a variable for specifying the user in the .pl files. You have to modify manually. Search for "sshcommand" - it should be easy to find and replace the "nagprobe" user. Be careful - there are more than one occurence of the user in this file.
- adjust the nmon tmpdir in query_nmon.pm
There is also no variable for the nmon_tmpdir - you also have to replace it manually. Its the directory where the nmon-files are placed when running via cron.
- adjust use in .pl files
You have to adjust the lineto point to the correct directory
Code: Select all
use lib "/srv/www/htdocs/cacti/scripts";
- test the script(s) manually on command line:
and it should return something. If not you can enable debugging via setting the variable $debug in the perl script to something greater 1.
Code: Select all
sudo -u [user of cacti poller] /usr/bin/perl /srv/www/htdocs/cacti/scripts/query_nmon_netstats.pl <servername> index
- Import Template