I am trying to build a new interface to measure SNMP Informant 64 bit disk counters. The way i want to go is to make a collection of scripts that are usefull for other jffnms users. So they can change some database ID's and then run the scripts on their own environment. But now when i am testing i have a little problem. I created the interface, pollers, poller groups, discovery & graph script. Jffnms does indeed discover the disks, however if i add them i get an error. what is causing this error ? thanks in advance. regards, Sebastian
<<attachment: interface discovery.JPG>>
Warning: Invalid argument supplied for foreach() in /opt/jffnms/lib/api.interface.inc.php on line 523
INSERT into pollers (id, name, description, command, parameters)
VALUES
(
'12011' ,
'PN_inf64_queuelength_curr' ,
'Inf-64 Disk CurrentDiskQueue' ,
'snmp_counter' ,
'.1.3.6.1.4.1.9600.1.2.44.1.16.<index>'
)
INSERT into pollers (id, name, description, command, parameters)
VALUES
(
'12012' ,
'PN_inf64_queuelength_avg' ,
'Inf-64 Disk AvgDiskQueu' ,
'snmp_counter' ,
'.1.3.6.1.4.1.9600.1.2.44.1.10.<index>'
)
INSERT into pollers_groups (id, description, interface_type)
VALUES
(
'12010' ,
'Informant64 Disks' ,
'12000'
)
INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES
(
'12010' ,
'10' ,
'12011' ,
'9'
)
INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES
(
'12010' ,
'20' ,
'12012' ,
'9'
)
INSERT into interface_types (
id ,
description ,
autodiscovery_validate ,
autodiscovery_enabled ,
autodiscovery_function ,
autodiscovery_parameters ,
autodiscovery_default_poller ,
have_graph ,
rrd_structure_rra ,
rrd_structure_res ,
rrd_structure_step ,
graph_default ,
break_by_card ,
update_handler ,
allow_manual_add ,
sla_default ,
have_tools
)
VALUES
(
'12000' ,
'Informant Disks 64' ,
'1' ,
'1' ,
'd_informant_64' ,
'' ,
'12010' ,
'1' ,
'RRA:AVERAGE:0.5:1:<resolution>' ,
'103680' ,
'300' ,
'12001' ,
'0' ,
'none' ,
'0' ,
'1' ,
'0'
)
INSERT into graph_types
(
id ,
description ,
type ,
graph1 ,
graph2 ,
sizex1 ,
sizey1 ,
sizex2 ,
sizey2 ,
allow_aggregation
)
VALUES
(
'12001' ,
'Curr-Avg Disk Queue' ,
'12000' ,
'GP_inf-64-totalque' ,
'NULL' ,
'500' ,
'175' ,
'0' ,
'0' ,
'0'
)
INSERT into interface_types_fields
(
description ,
name ,
pos ,
itype ,
ftype ,
showable ,
overwritable ,
tracked ,
default_value
)
VALUES
(
'Informant 64 Curr Queue Lenth' ,
'PN_inf64_queuelength_curr' ,
'10' ,
'12000' ,
'20' ,
'0' ,
'0' ,
'0' ,
'0'
)
INSERT into interface_types_fields
( description ,
name ,
pos ,
itype ,
ftype ,
showable ,
overwritable ,
tracked ,
default_value
)
VALUES
(
'Informant 64 Avg Queue Lenth' ,
'PN_inf64_queuelength_avg' ,
'20' ,
'12000' ,
'20' ,
'0' ,
'0' ,
'0' ,
'0'
)
<?
function discovery_d_informant_64($ip, $community, $hostid, $param) {
$interfaces = array();
$lDiskEntry_oid = ".1.3.6.1.4.1.9600.1.2.44.1.1.2";
if ($ip && $community && $hostid) {
$DisksEntries = snmp_walk($ip, $community, $lDiskEntry_oid, true);
if (is_array($DisksEntries))
foreach ($DisksEntries as $oid=>$interface) {
$index = join(".",array_slice(explode(".",$oid),7));
$interfaces[$index] = array (
'interface' => $interface." Stats",
'oper' => "up"
);
}
else
return false;
}
return $interfaces;
}
?>
<?php
/* SNMP Informant Disk Graph. This file is part of JFFNMS.
* Copyright (C) <2005> Sebastian van Dijk <[EMAIL PROTECTED]>
* This program is licensed under the GNU GPL, full terms in the LICENSE file
*/
function graph_GP_inf-64-totalque ($data) {
$opts_DEF =
rrdtool_get_def($data,array("curr_queue"=>"PN_inf64_queuelength_curr","avg_queue"=>"PN_inf64_queuelength_avg"));
$opts_GRAPH = array(
"CDEF:ldisk_rate_total=curr_queue,avg_queue,+",
"CDEF:avg_queue_graph=avg_queue,-1,*",
"COMMENT:' Disk Total '",
"GPRINT:ldisk_rate_total:MAX:'Max\:%8.2lf %s '",
"GPRINT:ldisk_rate_total:AVERAGE:'Average\:%8.2lf %s '",
"GPRINT:ldisk_rate_total:LAST:'Last\:%8.2lf %s \\n'",
"AREA:curr_queue#0000CC:'Curr. Disk Queue '",
"GPRINT:curr_queue:MAX:'Max\:%8.2lf %s '",
"GPRINT:curr_queue:AVERAGE:'Average\:%8.2lf %s '",
"GPRINT:curr_queue:LAST:'Last\:%8.2lf %s \\n'",
"AREA:avg_queue_graph#FF0000:'Avg. Disk Queue '",
"GPRINT:avg_queue:MAX:'Max\:%8.2lf %s '",
"GPRINT:avg_queue:AVERAGE:'Average\:%8.2lf %s '",
"GPRINT:avg_queue:LAST:'Last\:%8.2lf %s \\n'"
);
$opts_header[] = "--vertical-label='AVG/Curr Disk Queue'";
return array ($opts_header, @array_merge($opts_DEF,$opts_GRAPH));
}
?>
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ jffnms-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jffnms-users
