Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_hwinfo

Rating
3 votes
Favoured:
0
Current Version
1.3, 1.6 for Linux version
Last Release Date
2013-05-15
Owner
Hits
170111
Files:
FileDescription
check_hwinfo.wsf.txtVisual Basic script for Windows
hwinfo.phpPHP script for web view of results
check_hwinfo.plPerl script for Linux
process-service-perfdataperformance handler for check_hwinfo
hwinfo.phpPHP script to present a directory of check_hwinfo outputs
check_hwinfo.README.txtInstallation and configuration instructions
check_nrpe_hwinfo.shShell script for calling the plugin and writing to a file in /var/www/html/hwinfo/
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Get interesting but hard-to-get-at information about the server hardware, eg. free memory slots, front-side-bus speed et al
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 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
* Which OS is installed (Windows version/Linux version)
* Architecture (i386/i686/x86_64)
* 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

check_hwinfo.pl [-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/check_hwinfo.pl
command[check_hwinfo_csv]=/usr/bin/sudo /usr/lib/nagios/plugins/check_hwinfo.pl -t csv



In /etc/sudoers add

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




NRPE_NT usage:

``command[check_hwinfo]=c:windowssystem32cscript.exe //NoLogo //T:10 "C:Program Filesnrpe_nt.0.8bbincheck_hwinfo.wsf"``
``command[check_hwinfo_csv]=c:windowssystem32cscript.exe //NoLogo //T:10 "C:Program Filesnrpe_nt.0.8bbincheck_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?).
Reviews (2)
I'm running this as a remote nrpe command. The wsp file sits on the remove Windows server. NRPE locally and remote execution comes back with "NRPE: Unable to read output" This is true for csv or str. The wsp file runs fine on its own, just not passing that data through NRPE :(
byjohnbrookes, October 21, 2010
Useful little check, this.

Made a couple of changes:

1)Security

Perl - correctly - complains about 'Insecure $ENV{ENV}' when running interactively, so added the lines:

75a76,78
> # Security
> delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
>


2) Allowed it to work on SLES boxen

268c271,275
$file = " } elsif ( -e "/etc/SuSE-release" ) {
> $file = " }