This is not a conventional plugin, in that it always returns OK.

Actually, it is more of an idea than a normal check-plugin.

The idea is to get a list of all the different servers being monitored, with a view to returning the interesting but hard-to-get-at information about the server hardware, including

  • System info
  • Make and Model of the motherboard
  • Serial number (useful for Dell/HP servers)
  • CPU Info
  • Number of CPUs installed
  • CPU clock speed (1st CPU only)
  • CPU Level-2 cache size ( " )
  • CPU Front-Side-Bus speed ( " )
  • Memory info
  • Total memory installed
  • Is it ECC memory
  • Number of free memory slots
  • Size of the installed memory modules
  • Disks
  • Size of the disks
  • Is raid being used
  • OS
  • Which OS is installed (Windows version/Linux version)
  • Kernel version (running and latest installed rpm)
  • A select range ports and virtual IP's the server is listening on
  • The Dell DRAC IP or HP ILO IP

    The plugin is called via NRPE or NRPE_NT, and can produce csv-compatible output (useful for compiling spreadsheets of existing hardware)

    Usage [-t csv|str]

    -t csv ... output one-line in csv format (quoted strings, comma-separated)

    -t str ... use str as separator

This command must be run as the root user (dmidecode and netstat require it).

NRPE usage

command[check_hwinfo]=/usr/bin/sudo /usr/lib/nagios/plugins/

command[check_hwinfo_csv]=/usr/bin/sudo /usr/lib/nagios/plugins/ -t csv

In /etc/sudoers add

nagios ALL=NOPASSWD: /usr/lib/nagios/plugins/ "", /usr/lib/nagios/plugins/ -t csv

NRPE_NT usage:

command[check_hwinfo]=c:&92;windows&92;system32&92;cscript.exe //NoLogo //T:10 "C:Program Files&92;nrpe_nt.0.8b&92;bin&92;check_hwinfo.wsf"

command[check_hwinfo_csv]=c:&92;windows&92;system32&92;cscript.exe //NoLogo //T:10 "C:&92;Program Files&92;nrpe_nt.0.8b&92;bin&92;check_hwinfo.wsf" /sep:csv

Sample output (Regular output):

[Dell Computer Corporation:PowerEdge 2850:ABCDE1S][2:Xeon:3600 MHz:2048 KB:800 MHz][4096 M:Multi-bit ECC:2048M/2048M/0/0/0/0][sda=683.1 G:MegaRAID,LD 0 RAID5 699G,521X][Red Hat Enterprise Linux ES release 4 (Nahant Update 3)]

[Dell Inc.:PowerEdge 2950:ABCDE1S][1:Intel(R) Xeon(TM) CPU 3.00GHz:2992 MHz:4096 KB:667 MHz][2048M:Multi-bit ECC:512M/512M/512M/512M/0/0/0/0][232 G / 1396 G / / 699 G:DELL PERC 5/i SCSI Disk Device / DELL PERC 5/i SCSI Disk Device / Dell Virtual Floppy USB Device / ST375064 0A USB Device][Microsoft(R) Windows(R) Server 2003, Enterprise Edition]

Sample output (csv):

"Dell Computer Corporation","PowerEdge 2850","ABCDE1S","2","Xeon","3600 MHz","2048 KB","800 MHz","4096 M","Multi-bit ECC","2048M/2048M/0/0/0/0","sda=683.1 G","MegaRAID,LD 0 RAID5 699G,521X","Red Hat Enterprise Linux ES release 4 (Nahant Update 3)"

"VIA Technologies, Inc.","VT82C694X","","1","Unknown Intel P6 processor","1133 MHz","512 KB","133 MHz","1024M","Non-ECC","512M/512M/0/0","37 G","","Microsoft Windows NT Server"

Installation Notes:

On Windows NT, this script requires the script-o-matic software "wmicore_nt4.EXE" from Microsoft, and IE6 SP1

This is not necessary for Windows 2000 and Windows 2003

This plugin has not been tested on all Linux distributions. It does work on Red Hat ES, Mandriva, and Fedora.

This plugin may be used via the command-line check_nrpe command, like this:

check_nrpe -c check_hwinfo -H myserver

My current preferred way of using it is as a 'performance handler' using the script process-service-perfdata

The check_hwinfo service desscription must be "HW Info" or the script modified to suit.

This will write out a one-line file for each host which is configured to use the check_hwinfo plugin. The hostname is the filename. These files are collected in a single directory: /var/www/html/hwinfo/

The PHP script hwinfo.php is used to display this information in a neat table. The table can be sorted on any column.

If the PHP script encounters a file which has not been updated in the last 24 hours, this table entry is show 'greyed out'. This make it easy to identify 'stale' host-files.

hwinfo.php takes 2 possible arguments:

  • hwinfo.php?csv

... output in CSV format

  • hwinfo.php?dell

...output all Dell hosts and service tags as a CSV suitable for populating 'My Systems and Perihperals' on the Dell support site.

If the performance handler approach of populating the hwinfo directory is unsuitable, there are other ways to achieve this end.

This plugin is not comprehensive. Additions are welcome (eg a Solaris or HPUX version, anyone?).