1

I'm currently running Nagios 3 on Linux, with Windows clients using NSClient++. The Windows clients (8) will be put into a hot humid environment. I have all the basic checks working for CPU, RAM, etc under Nagios. But I need to find a way to monitor the CPU temp, then report those values back to the Linux server. I've seen a few solutions out there but they are vague. All the Windows machines have Supermicro MOBOs. Any advice would be appreciated.

2
  • I don't have the IPMI card, so I've dug around some more. I downloaded Getif and grabbed the temperature OID (System Temperature). I then ran the check_snmp command on the Linux box and grabbed the OID from the Windows machine. It's reports an "OK" though nagios. Now my problem is I can't get the -w or -c flags to report the temp. I keep getting "No valid data returned". The battle continues! Aug 19, 2009 at 16:59
  • 1
    Always get the IPMI card. Check to see if you can retrofit these, chances are you can. They are worth every penny, IMHO. Sep 17, 2013 at 16:14

3 Answers 3

1

I am not sure about the CPU monitoring, but you should also look at getting environmental monitoring in whatever space you are putting this server. It will allow you to have a better idea of what is going on in the space, and have more checks other than just CPU temp

http://nagios.org/products/environmental/

1

Under Linux there are a tool to read temperature/voltage/fan sensors, named lm-sensors. You can simply do a bash script that get information from sensors. Furthermore, there are also a perl script that do the job for you please check this pluging but first you have to install lm-sensors.

0

If you have the SuperMicro IPMI card, a gentleman here wrote a Nagios plugin to query the IPMI interface for those metrics.

#!/usr/bin/php -q
<?
/*
* check_ipmi for checking Supermicro IPMI on remote machine
* Gary Stimson 28aug2006
*/

$sIpmiTool = '/usr/bin/ipmitool';

if ($argc!=4)
{
print "Usage: ".$argv[0]." user password host\n";
exit(3);
}

$sUser = $argv[1];
$sPass = $argv[2];
$sHost = $argv[3];

$rExec = 0;
$aChassisLines= array();
$sCmd = "$sIpmiTool -U $sUser -P $sPass -H $sHost chassis status";
$s = exec($sCmd, &$aChassisLines, &$rExec);
if ($rExec)
{
print "Warning: Error running ipmitool command: $sCmd:" . implode("\n",$aChassisLines) . "\n";
exit(1);
}

$aChassisStatus=array();
foreach($aChassisLines as $sLine)
{
$aMatch = array();
if (preg_match('/(.*): (.*)/', $sLine, $aMatch))
{
$aChassisStatus[trim($aMatch[1])] = $aMatch[2];
}
}
if (count($aChassisStatus) < 8)
{
print "CRITICAL: Could not parse output from chassis list.";
exit(2);
}


if ($aChassisStatus['System Power'] != 'on')
{
print "OK: Switched off";
exit(0);
}

$iR = 0;
$asR = array();

$aChassisChecks = array('Power Overload', 'Main Power Fault', 'Power Control Fault', 'Drive Fault', 'Cooling/Fan Fault');
foreach ($aChassisChecks as $sCheck)
{
if ($aChassisStatus[$sCheck] != 'false')
{
$iR = 2;
$asR[] = $sCheck;
}
}


$rExec = 0;
$aSDRLines = array();
$sCmd = "$sIpmiTool -U $sUser -P $sPass -H $sHost sdr list";
$s = exec($sCmd, &$aSDRLines, &$rExec);
if ($rExec)
{
print "Warning: Error running ipmitool command: $sCmd:" . implode("\n",$aSDRLines) . "\n";
exit(1);
}

if (count($aSDRLines) < 10)
{
$iR = 2;
$sR = "Could not get sdr list. Machine uncontactable or other fault.";
}

$bParseErrorDone = false;
foreach($aSDRLines as $sLine)
{
$aFields = explode('|',$sLine);
if (count($aFields) < 3)
{
continue;
}

$sCaption = trim($aFields[0]);
$sDetail = trim($aFields[1]);
$sStatus = trim($aFields[2]);

// Power supply always seems to have 'cr' status so omit it from this check
// It is checked by the chassis check anyway
// Ignore Intrusion as well.
if ($sCaption != 'Power Supply' && $sCaption != 'Intrusion' && $sStatus != 'ok')
{
$iR = 2;
$asR[] = "$sCaption status '$sStatus': $sDetail";
}
}

$sR = implode('; ', $asR);
switch($iR)
{
case 0:
print "OK\n";
exit(0);
case 1:
print "Warning: $sR\n";
exit(1);
case 2:
print "CRITICAL: $sR\n";
exit(2);
}

?>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .