$warnings = ""; $unknowns = ""; $normals = ""; // set default values for command line arguments $cmdargs = ['port' => '161', 'log_level' => LOG__NONE, 'memwarn' => 80, 'memcrit' => 90, 'reboot' => 3600, 'thres-cpu-1sec' => '95,98', 'thres-cpu-5sec' => '85,95', 'thres-cpu-1min' => '70,90']; // parse the command line arguments parseArguments(); //print_r( $cmdargs ); die(); require 'OSS_SNMP/OSS_SNMP/SNMP.php'; $snmp = new \OSS_SNMP\SNMP($cmdargs['host'], $cmdargs['community']); checkCPU(); checkReboot(); checkPower(); checkFans(); checkTemperature(); checkMemory(); checkOthers(); if ($status == STATUS_OK) { $msg = "OK -{$normals}\n"; } else { $msg = "{$criticals}{$warnings}{$unknowns}\n"; } echo $msg; exit($status); /** * Checks the chassis temperature * */ function checkTemperature() { global $snmp, $cmdargs, $periods, $criticals, $warnings, $unknowns, $normals;
<td align="right" class="tdValues"><strong> <?php $registerGlobalsValue = (bool) ini_get("register_globals"); if ($registerGlobalsValue) { echo "<font color='red'>On <sup>#</sup></font>"; $error_found = true; } else { echo "<font color='green'>OK</font>"; } ?> </strong></td> </tr> <tr> <td class="tdComponent">Memory allocated for PHP script</td> <td align="right" class="tdValues"><?php echo checkMemory(); ?> </td> </tr> <?php $printMoreInfoLink = false; if (!is_writable(ROOT_PATH . '/lib/confs')) { echo "<tr> <td colspan='2'> "; echo "<font color='red'>* Web server requires write privilege to the following directory</font> "; print_r(ROOT_PATH . '/lib/confs'); echo "</td> </tr>"; $printMoreInfoLink = true; } if ($registerGlobalsValue) { echo "<tr> <td colspan='2'> "; echo "<font color='red'><sup>#</sup> The value of <strong>register_globals</strong> should be <strong>Off</strong> in php.ini file</font> ";