David,
I tried to do this patch by issuing :
/opt/jffnms/docs/utils# php import_custom.php dlima.patch
output ending with
return select_custom($name,$alarm_duration_options,$value);
Warning: Invalid argument supplied for foreach() in
/opt/jffnms/docs/utils/import_custom.php on line 95
Warning: Invalid argument supplied for foreach() in
/opt/jffnms/docs/utils/import_custom.php on line 140
Complete output attached. Anybody who can help ?
Greetz,
Johan
"LIMA David" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
01/29/2008 08:50 AM
To
<[email protected]>
cc
[EMAIL PROTECTED]
Subject
[jffnms-users] JFFNMS Plugins: IBM Blade, IBM Server, DS4XXX Storage
Controlers, Generic FC/SAN MIB
Hi List,
Here are some plugins that I have devel for JFFNMS, i have exported them
with export_custom.php script inside jffnms_path/docs/util, try to
import them carefully with import_custom script.
IBM Blade: the poller catches Hardware informations like serial number,
model ... and the status for each blade server and temperature + the
power consumption of the blade
IBM Server: poll the status of every hardware inside IBM based server:
raid card, network, cpu, disks, etc ... you must install director agent
IBM DS4XXX Controlers: you must install DSCLI for Linux on jffnms and
tunes some rights, the poller is pretty simple but it controls every
component inside the controler: FAN, Canister, Temperature, Fibre,
Disks, Arrays, Power etc ...
Generic FC MIB: control the status and speed of FC interfaces (based on
Public FC MIB).
Hope that helps, if something is missing, tell me, if someone wants to
cleanup, improve or extend the code ... you are welcome.
_______________
David LIMA
Professional Services
www.scc.com
______________________________________________________________________
Ce message contient des informations dont le contenu est susceptible
d'etre confidentiel.
Il est destine au(x) destinataire(s) indique(s) exclusivement.
A moins que vous ne fassiez partie de la liste des destinataires, ou que
vous soyez habilite a recevoir le mail a leur place, il vous est interdit
de le copier, de l'utiliser ou de devoiler son contenu a un tiers.
Si vous avez recu cet email par erreur, merci de prendre contact avec
l'emetteur.
Les opinions exprimees dans cet e-mail sont celles de l'emetteur et ne
refletent pas necessairement celles de l'entreprise.
Ce e-mail peut contenir des pieces jointes dont certaines pourraient
contenir des virus qui pourraient endommager votre systeme informatique.
La compagnie a pris toutes dispositions afin de minimiser ce risque et
decline toute responsabilite pour toute perte ou dommage resultant
directement ou indirectement de l'utilisation de cet email ou de son
contenu.
Il vous appartient d'effectuer vos propres controles anti-virus avant
d'ouvrir la ou les pieces jointes.
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________[attachment
"david_lima_scc.blade_fc_ibm_compaq_patches.tar.gz" deleted by Johan
Boeckx/EU/WTG/PENTAIR]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jffnms-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jffnms-users
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/cpqmib.inc.php
/opt/jffnms/engine/discovery/cpqmib.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/cpqmib.inc.php 2007-10-25
22:51:28.000000000 +0200
+++ /opt/jffnms/engine/discovery/cpqmib.inc.php 2006-11-09 16:18:54.000000000
+0100
@@ -7,6 +7,7 @@
DEFINE( phydrv ,'.1.3.6.1.4.1.232.3.2.5.1.1.');
DEFINE( fans, '.1.3.6.1.4.1.232.6.2.6.7.1.');
DEFINE( temp, '.1.3.6.1.4.1.232.6.2.6.8.1.');
+DEFINE( power, '.1.3.6.1.4.1.232.6.2.9.3.1.');
function discovery_cpqmib ($ip, $rocommunity, $hostid, $param)
{
$disc_type = $param;
@@ -80,6 +81,25 @@
}
}
break;
+ case 'powersupply':
+ $chassis = snmp_walk($ip, $rocommunity, power.'1');
+
+ if (is_array($chassis)) {
+ $bayindex = snmp_walk($ip, $rocommunity, power.'2');
+ $present = snmp_walk($ip, $rocommunity, power.'3');
+ $condition = snmp_walk($ip, $rocommunity,
power.'4');
+
+ foreach($chassis as $key => $cha) {
+ $interfaces[$ifnum++] = array(
+ 'interface' => "Power
$cha/$bayindex[$key]" ,
+ 'chassis' => $cha,
+ 'bayindex' => $bayindex[$key],
+ 'admin' =>
$present[$key]==3?'up':'down',
+ 'oper' =>
$condition[$key]==2?'up':'down',
+ );
+ }
+ }
+ break;
} // switch
return $interfaces;
+
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/fc_ports.inc.php
/opt/jffnms/engine/discovery/fc_ports.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/fc_ports.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/discovery/fc_ports.inc.php 2006-10-10
11:40:07.000000000 +0200
@@ -0,0 +1,50 @@
+<?
+/* Generic FC Ports . This file is part of JFFNMS
+ * Copyright (C) <2006> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+define(fcFxPortPhysOperStatus, '1.3.6.1.2.1.75.1.2.2.1.2');
+define(fcFxPortPhysAdminStatus, '1.3.6.1.2.1.75.1.2.2.1.1');
+
+function discovery_fc_ports($ip, $community, $hostid, $param) {
+ $interfaces = array();
+
+ if ($ip && $community && $hostid) {
+ $oidindex = snmp_walk($ip,$community,fcFxPortPhysOperStatus,true);
+ if ($oidindex ===FALSE) return FALSE;
+ foreach ($oidindex as $oid => $value) {
+ $realindex = join(".",array_slice(explode(".",$oid),7));
+ $admins = snmp_get($ip, $community,
fcFxPortPhysAdminStatus.".".$realindex);
+ $index =
join(".",array_slice(explode(".",$realindex),1));
+ $interfaces[$index] = array (
+ 'interface' => "FC Port ".($index-1),
+ 'oper' => fcport_oper($value),
+ 'admin' => fcport_admin($admins),
+ 'real_index' => $realindex,
+ );
+ }
+ }
+ //var_dump($interfaces);
+ return($interfaces);
+}
+
+function fcport_oper($status)
+{
+ if ($status == '1') return 'up'; #online
+ if ($status == '4') return 'down'; # link-failure
+ if ($status == '3') return 'testing'; # testing
+ return 'down';
+}
+
+function fcport_admin($status)
+{
+ if ($status == '1') return 'up'; #online
+ if ($status == '3') return 'testing'; # testing
+ return 'down';
+}
+
+
+
+?>
+
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/ibm_blade_power.inc.php
/opt/jffnms/engine/discovery/ibm_blade_power.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/ibm_blade_power.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/discovery/ibm_blade_power.inc.php 2005-09-19
23:54:14.000000000 +0200
@@ -0,0 +1,41 @@
+<?
+/* IBM Blade Servers. This file is part of JFFNMS
+ * Copyright (C) <2005> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+// Some used OID for this interface type
+define(fuelGaugeIndex, '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.1');
+define(fuelGaugeStatus, '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.3');
+define(fuelGaugeFirstPowerModule, '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4');
+define(fuelGaugeSecondPowerModule, '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5');
+define(fuelGaugeTotalPower, '.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7');
+
+function discovery_ibm_blade_power($ip, $community, $hostid, $param) {
+ $interfaces = array();
+
+ if ($ip && $community && $hostid) {
+ $indexes = snmp_walk($ip, $community, fuelGaugeIndex);
+
+ if ($indexes !== FALSE) {
+ $fuelgaugestatus = snmp_walk($ip, $community, fuelGaugeStatus);
+ $fuelgaugefirstpowermodule = snmp_walk($ip, $community,
fuelGaugeFirstPowerModule);
+ $fuelgaugesecondpowerpodule = snmp_walk($ip, $community,
fuelGaugeSecondPowerModule );
+ $fuelgaugetotalpower = snmp_walk($ip,$community, fuelGaugeTotalPower);
+
+ foreach($indexes as $idx=>$index) {
+ $interfaces[$index] = array (
+ 'admin'=> 'ok',
+ 'interface' => "Power domain $index",
+ 'status' => $fuelgaugestatus[$idx],
+ 'module1' => $fuelgaugefirstpowermodule[$idx],
+ 'module2' => $fuelgaugesecondpowerpodule[$idx],
+ 'totalpower' => $fuelgaugetotalpower[$idx],
+ );
+ }
+ }
+ }
+ //debug ($interfaces);
+ return $interfaces;
+}
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/ibm_blade_servers.inc.php
/opt/jffnms/engine/discovery/ibm_blade_servers.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/ibm_blade_servers.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/discovery/ibm_blade_servers.inc.php 2006-10-05
16:45:48.000000000 +0200
@@ -0,0 +1,65 @@
+<?php
+/* IBM Blade Servers. This file is part of JFFNMS
+ * Copyright (C) <2005> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+// Some used OID for this interface type
+define(BladeServerIndex, '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.1');
+define(BladeServerSerial, '.1.3.6.1.4.1.2.3.51.2.2.21.4.1.1.11');
+define(BladeServerState, '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.3');
+define(BladeServerHealthState, '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.5');
+define(BladeServerName, '.1.3.6.1.4.1.2.3.51.2.22.1.5.1.1.6');
+define(BladeManufDate, '.1.3.6.1.4.1.2.3.51.2.2.21.4.1.1.9');
+
+function discovery_ibm_blade_servers($ip, $community, $hostid, $param) {
+
+ $interfaces = array();
+
+ if ($ip && $community && $hostid) {
+ $indexes = snmp_walk($ip, $community, BladeServerIndex);
+ if ($indexes === FALSE) return FALSE;
+ $bladeserverserial = snmp_walk($ip, $community, BladeServerSerial);
+ $bladeserverstate = snmp_walk($ip, $community, BladeServerState);
+ $bladeservername = snmp_walk($ip, $community, BladeServerName);
+ $bladeserverhealth = snmp_walk($ip,$community, BladeServerHealthState);
+ $blademanufdate = snmp_walk($ip,$community, BladeManufDate);
+
+ if ($indexes !== FALSE) {
+ foreach($indexes as $index) {
+ $idx = $index-1;
+ if (!isset($bladeserverserial["$idx"]))
+ $bladeserverserial="N/A";
+ else
+ $bladeserverfru= $bladeserverserial["$idx"];
+ if (!isset($bladeservername["$idx"])) $bladeservername["$idx"]
= 'N/A';
+ if (!isset($blademanufdate["$idx"])) $blademanufdate["$idx"] =
'N/A';
+ if (isset($bladeserverstate["$idx"]) &&
$bladeserverstate["$idx"] == '1') {
+ $admin = 'Up';
+ } else {
+ $admin = 'No blade present';
+ }
+
+ switch ($bladeserverhealth["$idx"]) {
+ case "0": $bladeserverhealth["$idx"] = "N/A"; break;
+ case "1": $bladeserverhealth["$idx"] = "good"; break;
+ case "2": $bladeserverhealth["$idx"] = "warning"; break;
+ case "3": $bladeserverhealth["$idx"] = "bad"; break;
+ }
+
+ $interfaces["$index"] = array (
+ //'interface' => $index,
+ 'serial' => $bladeserverfru,
+ 'admin' => $admin,
+ 'interface' => $bladeservername["$idx"],
+ 'manuf_date' => $blademanufdate["$idx"],
+ 'health_state' => $bladeserverhealth["$idx"],
+ );
+ }
+ }
+ }
+ //debug ($interfaces);
+ //var_dump($interfaces);
+ return $interfaces;
+}
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/ibm_ComponentHealth.inc.php
/opt/jffnms/engine/discovery/ibm_ComponentHealth.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/ibm_ComponentHealth.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/discovery/ibm_ComponentHealth.inc.php 2006-10-03
17:47:09.000000000 +0200
@@ -0,0 +1,37 @@
+<?
+/* SNMP IBM component health Discovery. This file is part of JFFNMS.
+ * Copyright (C) <2006> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+*/
+
+ function discovery_ibm_ComponentHealth($ip, $community, $hostid, $param) {
+
+ $interfaces = array();
+
+ $ComponentHealth_MIB = ".1.3.6.1.4.1.2.6.159.1.1.30.3.1";
+ $KeyIndex_oid = $ComponentHealth_MIB.".1";
+
+
+ if ($ip && $community && $hostid) {
+
+ $ComponentEntries = snmp_walk($ip, $community, $KeyIndex_oid, true);
+ //var_dump($ComponentEntries);
+
+ if (is_array($ComponentEntries))
+ foreach ($ComponentEntries as $oid=>$interface) {
+
+ $index = join(".",array_slice(explode(".",$oid),10));
+
+
+ $interfaces[$index] = array (
+ 'interface' => $interface,
+ 'oper' => "OK"
+ );
+ }
+ else
+ return false;
+ }
+
+ return $interfaces;
+ }
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/ibm_ds_storage.inc.php
/opt/jffnms/engine/discovery/ibm_ds_storage.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/ibm_ds_storage.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/discovery/ibm_ds_storage.inc.php 2007-01-22
12:23:39.000000000 +0100
@@ -0,0 +1,161 @@
+<?
+
+
+function discovery_ibm_ds_storage ($ip, $hostname, $rwcommunity, $param)
+{
+$sudo_bin=exec("which sudo");
+$smcli_bin=exec("which SMcli",$retval1);
+if ($retval1 == "127") return FALSE ;
+$device=$param;
+$interfaces=array();
+
+switch($device) {
+
+ case 'storagesubsystem':
+ $smcli_cmd = "-S -e -c \"show storagesubsystem healthstatus;\"";
+ $command = "$sudo_bin $smcli_bin $ip $smcli_cmd";
+ $pattern = '/Storage Subsystem health status = optimal./';
+ exec($command,$output,$retval);
+ //debug($output);
+ if ($retval == "4") return FALSE;
+ //FIXME add more checks to return status like: poller error
+ //debug($retval);
+ //foreach ($output as $lines) {
+ // if (preg_match($pattern,$lines,$parts) == TRUE) {
+ $interfaces[$index++];
+ $interfaces[$index] = array (
+ 'interface' => "IBM Storage ".gethostbyname($ip) ,
+ 'oper' => "up/not tested",
+ );
+ break;
+
+ }
+ return $interfaces ;
+}
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/discovery/tcp_ports.inc.php
/opt/jffnms/engine/discovery/tcp_ports.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/discovery/tcp_ports.inc.php
2007-10-25 22:51:29.000000000 +0200
+++ /opt/jffnms/engine/discovery/tcp_ports.inc.php 2006-10-24
17:41:50.000000000 +0200
@@ -25,7 +25,7 @@
if (count($data)==3) {
$pos1 = strpos($data[1],"Ports")+6;
if ($pos1 > 6) {
- $pos2 = strpos($data[1],"Ignored");
+ $pos2 = strpos($data[1],"\n");
$data_line = substr($data[1],$pos1,$pos2-$pos1);
$data_ports = explode(",",$data_line);
}
--- /usr/local/src/jffnms-0.8.3/engine/discovery/ups.inc.php 2007-10-25
22:51:28.000000000 +0200
+++ /opt/jffnms/engine/discovery/ups.inc.php 2007-01-08 14:58:14.000000000
+0100
@@ -8,7 +8,7 @@
$ups = array();
$UPSMIB = ".1.3.6.1.2.1.33"; //SNMPv2-SMI::mib-2.33
- $upsIdentName_oid = $UPSMIB.".1.1.5.0"; //UPS-MIB::upsIdentName.0
+ $upsIdentName_oid = $UPSMIB.".1.1.6.0"; //UPS-MIB::upsIdentName.0
$upsBatteryStatus_oid = $UPSMIB.".1.2.1.0";
//UPS-MIB::upsBatteryStatus.0
$battery_status = array (1=>"battery unknown", 2=>"battery normal",
3=>"battery low", 4=>"batter depleted");
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/graphs/cisco_80211X_associated.inc.php
/opt/jffnms/engine/graphs/cisco_80211X_associated.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/graphs/cisco_80211X_associated.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/graphs/cisco_80211X_associated.inc.php 2007-01-11
15:32:34.000000000 +0100
@@ -0,0 +1,24 @@
+<?
+/* CIsco 80211.X associated Graph. This file is part of JFFNMS
+ * Copyright (C) <2007> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+function graph_cisco_80211X_associated($data) {
+
+ $opts_DEF = rrdtool_get_def($data,array("associated"));
+
+ $opts_GRAPH = array(
+ "AREA:associated#0033FF:'Associated clients '",
+ "GPRINT:associated:MAX:'Max\: %3.0lf '",
+ "GPRINT:associated:AVERAGE:'Average\: %3.0lf '",
+ "GPRINT:associated:LAST:'Last\: %3.0lf \\n'",
+ );
+
+ $opts_header[] = "--vertical-label='Cisco 802.11X clients'";
+ $opts_header[] = "--rigid";
+
+ return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));
+}
+
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/graphs/ibm_blade_cpu_temp2.inc.php
/opt/jffnms/engine/graphs/ibm_blade_cpu_temp2.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/graphs/ibm_blade_cpu_temp2.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/graphs/ibm_blade_cpu_temp2.inc.php 2006-10-24
10:39:15.000000000 +0200
@@ -0,0 +1,28 @@
+<?
+/* This file is part of JFFNMS
+ * Copyright (C) <2002-2005> Javier Szyszlican <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+function graph_ibm_blade_cpu_temp2($data) {
+
+ $opts_DEF = rrdtool_get_def($data,array("temperature2","temperature"));
+
+ $opts_GRAPH = array(
+
+ "LINE2:temperature2#00CC00:'Cpu2 Temperature'",
+ "GPRINT:temperature2:MAX:'Max\:%5.0lf%s°'",
+ "GPRINT:temperature2:AVERAGE:'Average\:%5.0lf%s°'",
+ "GPRINT:temperature2:LAST:'Last\:%5.0lf%s°\\n'",
+
+ "LINE2:temperature#0000FF:'Cpu1 Temperature'",
+ "GPRINT:temperature:MAX:'Max\:%5.0lf%s°'",
+ "GPRINT:temperature:AVERAGE:'Average\:%5.0lf%s°'",
+ "GPRINT:temperature:LAST:'Last\:%5.0lf%s°'"
+ );
+
+ $opts_header[] = "--vertical-label='Degres Centigrade'";
+
+ return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));
+}
+
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/graphs/ibm_blade_power.inc.php
/opt/jffnms/engine/graphs/ibm_blade_power.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/graphs/ibm_blade_power.inc.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/graphs/ibm_blade_power.inc.php 2006-10-25
13:06:02.000000000 +0200
@@ -0,0 +1,23 @@
+<?
+/* Blade Power consumption Graph. This file is part of JFFNMS
+ * Copyright (C) <2005> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+ function graph_ibm_blade_power ($data) {
+
+ $opts_DEF = rrdtool_get_def($data,array("fuelGaugePowerInUse"));
+
+ $opts_GRAPH = array(
+ "AREA:fuelGaugePowerInUse#0033AA:'Watts '",
+ "GPRINT:fuelGaugePowerInUse:MAX:'Max\: %6.2lf %sWatts'",
+ "GPRINT:fuelGaugePowerInUse:AVERAGE:'Average\: %6.2lf %sWatts'",
+ "GPRINT:fuelGaugePowerInUse:LAST:'Last\: %6.2lf %sWatts\\n'",
+ );
+
+ $opts_header[] = "--vertical-label='Power'";
+
+ return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));
+ }
+
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/graphs/temperature_aggregation.inc.php
/opt/jffnms/engine/graphs/temperature_aggregation.inc.php
--- /usr/local/src/jffnms-0.8.3/engine/graphs/temperature_aggregation.inc.php
2007-10-25 22:51:28.000000000 +0200
+++ /opt/jffnms/engine/graphs/temperature_aggregation.inc.php 2006-09-26
11:29:18.000000000 +0200
@@ -25,7 +25,7 @@
$far = (isset($interface["show_celcius"]) &&
($interface["show_celcius"]==0))?1:0;
$description =
- substr(str_pad($interface["host_name"]."
".$interface["zone_shortname"],20," ",STR_PAD_RIGHT),0,20)." ".
+ substr(str_pad($interface["host_name"]."
".$interface["location"],20," ",STR_PAD_RIGHT),0,20)." ".
substr(str_pad(str_replace("temperature","",$interface["description"]),20,"
",STR_PAD_RIGHT),0,20)." ".
str_pad((($far==1)?"Fahrenheit":"Celcius"),10," ");
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/pollers/ibm_ds_storage.php
/opt/jffnms/engine/pollers/ibm_ds_storage.php
--- /usr/local/src/jffnms-0.8.3/engine/pollers/ibm_ds_storage.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/pollers/ibm_ds_storage.php 2007-01-03
16:57:16.000000000 +0100
@@ -0,0 +1,151 @@
+<?
+
+
+function poller_ibm_ds_storage ($options)
+{
+$smcli_bin=exec("which SMcli");
+$sudo_bin=exec("which sudo");
+$device=$options['poller_parameters'];
+$ip=$options['host_ip'];
+//$idx=$options['ctrl_idx'];
+//$interfaces=array();
+//debug($options);
+
+switch($device) {
+
+ case 'controler':
+ $smcli_cmd = "-S -e -c \"show storagesubsystem healthstatus;\"";
+ $command = "$sudo_bin $smcli_bin $ip $smcli_cmd";
+ //$ip=str_replace(".","\.",$ip);
+ $pattern = 'Storage Subsystem health status = optimal.';
+ exec($command,$output,$retval);
+ //debug($retval);
+ //debug($output);
+ //FIXME add more checks to return status like: poller error
+ $output = implode(",", $output);
+ if (eregi($pattern,$output)) {
+ $status=up;
+ } else {
+ //str_replace("The following failures have been
found:,"," ",$output);
+ $status="down| $output";
+ }
+ return $status;
+ break;
+ //$controllers=array('A','B');
+ //foreach ($controllers as $device) {
+ //foreach ($controllers as $ctrl_idx) {
+ // $smcli_cmd = "-e -c \"show controller [$idx];\"";
+ // $command = "$sudo_bin $smcli_bin $smcli_cmd";
+ // //echo $command;
+ // unset($output);
+ // exec($command,$output,$retval);
+ // if ($retval == "4") return FALSE;
+ // $lines=join("",$output);
+ // preg_match('/Status:\s+(\w+)/',$lines,$state);
+ // $status=$state[1]=="Online"?"up":"down";
+ // return $status;
+ // //}
+ // break;
+
+ case 'arrays':
+ //FIXME: interface with: name,
+ $smcli_cmd = "-e -c \"show storagesubsystem summary;\"";
+ $command = "$smcli_bin $ip $ip2 $smcli_cmd";
+ $pattern = '/Number of arrays:\s+(\d+)/';
+ echo "Device type is $device\n";
+ exec($command,$output);
+ print_r($output);
+ $output2=join("",$output);
+ //var_dump($output2);
+ preg_match($pattern,join("",$output),$matches);
+ $nb_arrays=$matches[1];
+ echo "Number of arrays: "."$nb_arrays"."\n";
+ break;
+
+ case 'drives':
+ if ($smcli_bin === FALSE) return FALSE;
+ $smcli_cmd = "-e -c \"show allDrives summary;\"";
+ $command = "$smcli_bin $ip $ip2 $smcli_cmd";
+ $pattern = '/^\s{6}(\d+),\s+(\d+)\s+([aA-zZ]+)/';
+ $keyz=0;
+ exec($command,$output);
+ //var_dump($output);
+ foreach ($output as $drivez) {
+ if (preg_match($pattern,$drivez,$drive) == TRUE) {
+ $keyz++;
+ $interfaces[$index]=array (
+ 'interfaces' => "Drive ".$keyz,
+ 'tray' => $drive[1],
+ 'slot' => $drive[2],
+ 'oper' => $drive[3]=="Optimal"?"up":"down",
+ 'drv_idx' => $keyz,
+ );
+ var_dump($interfaces);
+ }
+ }
+ break;
+
+
+ case 'logdrives':
+ if ($smcli_bin === FALSE) return FALSE;
+ $smcli_cmd = "-e -c \"show allLogicalDrives;\"";
+ $pattern =
'/(\w+)\s+(\w+)\s+([0-9]*\,?[0-9]*\.?[0-9]*)\s[MKG]B\s+(\d+)\s+(\d+)$/';
+ $keyz=0;
+ $command = "LANG=US $smcli_bin $ip $ip2 $smcli_cmd";
+ //$tempdir =
get_config_option("engine_temp_path")."/"."$hostname$ip";
+ //$tempfile =
"/opt/jffnms/engine/temp"."/".$hostname.$case;
+ //echo "Tempfile is: ".$tempfile."\n";
+ //$fp = fopen($tempfile, "w");
+ exec($command,$output);
+ print_r($output);
+ foreach ($output as $line) {
+ if (preg_match($pattern,$line,$logdrive) ==
TRUE) {
+ //var_dump($logdrive);
+
//fputs($fp,$keyz.";".$logdrive[1].";".$logdrive[2].";".$logdrive[3].";".$logdrive[4]."\n");
+ $interfaces[$index] = array (
+ 'interface' => $logdrive[1],
+ 'logdrive_idx' => $keyz,
+ 'oper' =>
$logdrive[2]=="Optimal"?"up":"down",
+ 'capacity' => $logdrive[3],
+ 'array' => $logdrive[4],
+ );
+ //$index++;
+ $keyz++;
+ print_r($interfaces);
+ }
+ }
+ //fclose($fp);
+
+ break;
+
+
+ case 'drivesbad':
+ //FIXME: interface with: name,
+ $smcli_cmd = "-e -c \"show allDrives summary;\"";
+ $command = "$smcli_bin $ip $ip2 $smcli_cmd";
+ $pattern = '/(\d+),\s+(\d+)\s+(\w+)\s+/';
+ exec($command,$output);
+ print_r($output);
+ foreach ($output as $lines) {
+ //echo "Traitement de ligne: ".$lines;
+ preg_match_all($pattern,$lines,$matches);
+ foreach ($matches as $index => $value) {
+ $interfaces[$index] = array (
+ 'interface' => "Drive ".$index,
+ 'tray' => $value[1],
+ 'slot' => $value[2],
+ 'oper' => $value[3],
+ );
+ }
+
+ }
+ break;
+
+ }
+ return $interfaces ;
+}
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/pollers/snmp_counter_ibm.php
/opt/jffnms/engine/pollers/snmp_counter_ibm.php
--- /usr/local/src/jffnms-0.8.3/engine/pollers/snmp_counter_ibm.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/pollers/snmp_counter_ibm.php 2006-10-05
21:41:20.000000000 +0200
@@ -0,0 +1,28 @@
+<?
+/* This file is part of JFFNMS
+ * Copyright (C) <2002-2005> David LIMA <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+function poller_snmp_counter_ibm ($options) {
+ extract($options);
+
+
+
+
+//$pattern='/(\d+([,.]\d+)?)/';
+
+
+
+ $oid = $poller_parameters;
+
+ if ($ro_community) { //dont do anything if we dont have the community
+ $value = (get_snmp_counter($host_ip,$ro_community,$oid));
+ //$value = preg_split($pattern,$value);
+ //print_r("$value2");
+ settype($value,int);
+ //echo "$value\n";
+ }
+
+ return $value;
+}
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/pollers/snmp_status_ibm.php
/opt/jffnms/engine/pollers/snmp_status_ibm.php
--- /usr/local/src/jffnms-0.8.3/engine/pollers/snmp_status_ibm.php
1970-01-01 01:00:00.000000000 +0100
+++ /opt/jffnms/engine/pollers/snmp_status_ibm.php 2007-01-11
13:44:26.000000000 +0100
@@ -0,0 +1,42 @@
+<?php
+/* Generic snmp status poller. This file is part of JFFNMS
+ * Copyright (C) <2004> Craig Small <[EMAIL PROTECTED]>
+ * This program is licensed under the GNU GPL, full terms in the LICENSE file
+ */
+
+/*
+ * parameters: <oid>|<val1>=<ret1>,<val2>=<ret2>,....
+ *
+ * <oid> is the SNMP OID to be polled
+ * <valN> is the SNMP value to match
+ * <retN> is the value returned if SNMP get equals valN
+ *
+ * If there is no match, then 'down' is returned.
+ */
+
+ function poller_snmp_status_ibm ($options) {
+
+ $community = $options['ro_community'];
+ $ip = $options['host_ip'];
+
+ list($oid, $valstr) = explode(',', $options['poller_parameters']);
+ $match_pairs = explode('|', $valstr);
+
+
+ if ($ip && $community && $oid && $valstr) {
+ $snmp_value = (int) (snmp_get($ip, $community, $oid));
+ foreach($match_pairs as $match_pair) {
+ list ($match_string, $return_value) = explode('=',
$match_pair);
+ if ($match_string==NULL || $return_value==NULL) {
+ logger("The matching pair \"$match_pair\" is not in
<match>=<value> format.\n");
+ return 'down';
+ }
+
+ if ($match_string == $snmp_value)
+ return $return_value;
+ }
+ }
+ return 'down';
+ }
+
+?>
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/engine/pollers/snmp_status.php
/opt/jffnms/engine/pollers/snmp_status.php
--- /usr/local/src/jffnms-0.8.3/engine/pollers/snmp_status.php 2007-10-25
22:51:29.000000000 +0200
+++ /opt/jffnms/engine/pollers/snmp_status.php 2006-10-04 17:43:00.000000000
+0200
@@ -21,12 +21,13 @@
list($oid, $valstr) = explode(',', $options['poller_parameters']);
$match_pairs = explode('|', $valstr);
+
if ($ip && $community && $oid && $valstr) {
$snmp_value = snmp_get($ip, $community, $oid);
foreach($match_pairs as $match_pair) {
list ($match_string, $return_value) = explode('=',
$match_pair);
- if (!$match_string || !$return_value) {
+ if ($match_string==NULL || $return_value==NULL) {
logger("The matching pair \"$match_pair\" is not in
<match>=<value> format.\n");
return 'down';
}
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/htdocs/events.php /opt/jffnms/htdocs/events.php
--- /usr/local/src/jffnms-0.8.3/htdocs/events.php 2007-10-25
22:51:30.000000000 +0200
+++ /opt/jffnms/htdocs/events.php 2008-01-23 00:11:47.000000000 +0100
@@ -32,10 +32,10 @@
if ($filtrorow=="host") $filter = "$filter and $oper
(<events_table>.host = $filtrovalue)";
if ($filtrorow=="zone") $filter = "$filter and $oper
(hosts.zone = $filtrovalue)";
if ($filtrorow=="type") $filter = "$filter and $oper
(<events_table>.type = $filtrovalue)";
- if ($filtrorow=="username") $filter = "$filter and $oper
(<events_table>.username LIKE '%$filtrovalue%')";
+ if ($filtrorow=="username") $filter = "$filter and $oper
(<events_table>.username LIKE '%$filtrovalue')";
if ($filtrorow=="severity") $filter = "$filter and $oper
(types.severity = $filtrovalue)";
if ($filtrorow=="interface") $filter = "$filter and $oper
(<events_table>.interface LIKE '%$filtrovalue')";
- if ($filtrorow=="info") $filter = "$filter and $oper
(<events_table>.info LIKE '%$filtrovalue%')";
+ if ($filtrorow=="info") $filter = "$filter and $oper
(<events_table>.info LIKE '%$filtrovalue')";
if ($filtrorow=="ack") $filter = "$filter and $oper
(<events_table>.ack > 0)";
if ($filtrorow=="types") {
diff -x'*png' -x'*.ini*' -x'*rrd' -x'*log' -x'*sql' -x'jffnms.conf*' -Nru
/usr/local/src/jffnms-0.8.3/lib/gui.controls.inc.php
/opt/jffnms/lib/gui.controls.inc.php
--- /usr/local/src/jffnms-0.8.3/lib/gui.controls.inc.php 2007-10-25
22:51:27.000000000 +0200
+++ /opt/jffnms/lib/gui.controls.inc.php 2007-10-07 09:35:11.000000000
+0200
@@ -192,7 +192,7 @@
}
function select_alarm_duration($name, $value, $text = 0) {
- $alarm_duration_options = array(0=>"Default",300=>"5 Minutes",600=>"10
Minutes",1800=>"30 Minutes",3600=>"60 Minutes");
+ $alarm_duration_options = array(0=>"Default",300=>"5 Minutes",600=>"10
Minutes",900=>"15 Minutes",1800=>"30 Minutes",3600=>"60 Minutes");
if ($text==0)
return select_custom($name,$alarm_duration_options,$value);
Warning: Invalid argument supplied for foreach() in
/opt/jffnms/docs/utils/import_custom.php on line 95
Warning: Invalid argument supplied for foreach() in
/opt/jffnms/docs/utils/import_custom.php on line 140-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jffnms-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jffnms-users