Hi Craig, 

I fixed the index field but i do not know what you mean by interface
field.
Anyway, after adding the index field the problem solved.

The interface is discovered and JFFNMS is creating RRD files and values
are collected.

However, no i don't have graphs created as of the dreadfull "The RRDTool
files for Interface ID 3 (from Host ID 2), has not been created by the
Poller Process yet".

I do get RRD files, and for standard pollers i do get graphs, except
just for the extra ones i am configuring.

Can you give me another hint ?

Thanks, 



Met vriendelijke groet, 
 
 
Sebastian van Dijk
 

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Craig Small
Verzonden: dinsdag 25 september 2007 8:04
Aan: jffnms-users@lists.sourceforge.net
Onderwerp: Re: [jffnms-users] custom interface ;Invalid argument
supplied for foreach() in/opt/jffnms/lib/api.interface.inc.php

On Mon, Sep 17, 2007 at 11:27:27AM +0200, Dijk, Sebastian van wrote:
> I am trying to build a new interface to measure SNMP Informant 64 bit 
> disk counters.
Make sure you have an index field and an interface field. I've seen both
these sorts or errors if you do not specify both of these.

 - Craig
-- 
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA
DFA5
http://www.enc.com.au/                             csmall at :
enc.com.au
http://www.debian.org/          Debian GNU/Linux, software should be
Free 

------------------------------------------------------------------------
-
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
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users


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'                                     ,
                                'informant_64'                  ,
                                ''                                      ,
                                '12010'                                 ,
                                '1'                                     ,
                                'RRA:AVERAGE:0.5:1:<resolution>'        ,
                                '103680'                                ,
                                '300'                                   ,
                                '12001'                                 ,
                                '0'                                     ,
                                'none'                                  ,
                                '0'                                     ,
                                '1'                                     ,
                                '0'
);






INSERT into interface_types_fields
(
                                description                             ,
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Index'         , 
                                'index'         , 
                                '05'                                    , 
                                '12000'                                 , 
                                '3'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                ''                                       
);




INSERT into interface_types_fields
(
                                description                             ,
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Description'           , 
                                'description'           , 
                                '6'                                     , 
                                '12000'                                 , 
                                '7'                                     , 
                                '1'                                     , 
                                '1'                                     , 
                                '0'                                     , 
                                'SNMP Informant 64'                             
         
);


































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'                                     , 
                                
'DS:PN_inf64_queuelength_curr:GAUGE:600:0:10000'                                
         
);


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'                                     , 
                                'DS:PN_inf64_queuelength_avg:GAUGE:600:0:10000' 
                                
);






INSERT into interface_types_fields
(
                                description                             ,
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Avg Read Queue'           , 
                                'PN_inf64_queuel_avg_read'              , 
                                '30'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_queuel_avg_read:GAUGE:600:0:10000' 
                                 
);


INSERT into interface_types_fields
(                               description                             , 
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Avg Write Queue'          , 
                                'PN_inf64_queuel_avg_write'             , 
                                '40'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_queuel_avg:GAUGE:600:0:10000'      
                                
);







INSERT into interface_types_fields
(
                                description                             ,
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Read Time'                , 
                                'PN_inf64_read_time'                    , 
                                '50'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_read_time:GAUGE:600:0:10000'       
                                 
);


INSERT into interface_types_fields
(                               description                             , 
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Avg Write Time'           , 
                                'PN_inf64_write_time'                   , 
                                '60'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_write_time:GAUGE:600:0:10000'      
                                
);









INSERT into interface_types_fields
(
                                description                             ,
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Read Rate'                , 
                                'PN_inf64_read_rate'                    , 
                                '70'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_read_rate:GAUGE:600:0:10000'       
                                 
);


INSERT into interface_types_fields
(                               description                             , 
                                name                                    ,
                                pos                                     ,
                                itype                                   ,
                                ftype                                   ,
                                showable                                ,
                                overwritable                            ,
                                tracked                                 ,
                                default_value
)
        VALUES
(
                                'Informant 64 Avg Write Rate'           , 
                                'PN_inf64_write_rate'                   , 
                                '80'                                    , 
                                '12000'                                 , 
                                '20'                                    , 
                                '0'                                     , 
                                '0'                                     , 
                                '0'                                     , 
                                'DS:PN_inf64_write_rate:GAUGE:600:0:10000'      
                                
);








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','32');


INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
 VALUES ('12010','20','12012','32');

INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES ('12010','30','12013','32');


INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES ('12010','40','12014','32');

INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES ('12010','50','12015','32');

INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES ('12010','60','12016','32');


INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
VALUES ('12010','70','12017','32');


INSERT into pollers_poller_groups (poller_group, pos, poller, backend)
 VALUES ('12010','80','12018','32');





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 (id, name, description, command, parameters)
        VALUES
(
                '12013'                         ,
                'PN_inf64_queuel_avg_read'      , 
                'Inf-64 Disk avg Read DiskQueue'        , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.11.<index>'
);


INSERT into pollers (id, name, description, command, parameters)
        VALUES
(
                '12014'                         ,
                'PN_inf64_queuel_avg_write'     , 
                'Inf-64 Disk avg Write DiskQueue'       , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.12.<index>'
);


INSERT into pollers (id, name, description, command, parameters)
        VALUES
(
                '12015'                         ,
                'PN_inf64_read_time'    , 
                'Inf-64 Disk Read Time' , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.2.<index>'
);


INSERT into pollers (id, name, description, command, parameters)
        VALUES
(
                '12016'                         ,
                'PN_inf64_write_time'   , 
                'Inf-64 Disk Write Time'        , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.4.<index>'
);



INSERT into pollers (id, name, description, command, parameters)
        VALUES
(
                '12017'                         ,
                'PN_inf64_read_rate'    , 
                'Inf-64 Disk Read rate' , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.19.<index>'
);


INSERT into pollers (id, name, description, command, parameters)
        VALUES
(
                '12018'                         ,
                'PN_inf64_write_rate'   , 
                'Inf-64 Disk Write rate'        , 
                'snmp_counter'                  , 
                '.1.3.6.1.4.1.9600.1.2.44.1.22.<index>'
);
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'                    ,
                                ''                                      ,
                                '500'                                   ,
                                '175'                                   ,
                                '0'                                     ,
                                '0'                                     ,
                                '0'
);






INSERT into graph_types     
(
                                id                                      ,
                                description                             ,
                                type                                    ,
                                graph1                          ,
                                graph2                          ,
                                sizex1                          ,
                                sizey1                          ,
                                sizex2                          ,
                                sizey2                          ,
                                allow_aggregation               
)

        VALUES
(
                                '12002'                                 ,
                                'Read Write Avg Disk Queue'             ,
                                '12000'                                 ,
                                'GP_inf_64_rdrwque'                     ,
                                ''                                      ,
                                '500'                                   ,
                                '175'                                   ,
                                '0'                                     ,
                                '0'                                     ,
                                '0'
);



INSERT into graph_types     
(
                                id                                      ,
                                description                             ,
                                type                                    ,
                                graph1                          ,
                                graph2                          ,
                                sizex1                          ,
                                sizey1                          ,
                                sizex2                          ,
                                sizey2                          ,
                                allow_aggregation               
)

        VALUES
(
                                '12003'                                 ,
                                'Read Write Time'               ,
                                '12000'                                 ,
                                'GP_inf_64_rdrwtime'                    ,
                                ''                                      ,
                                '500'                                   ,
                                '175'                                   ,
                                '0'                                     ,
                                '0'                                     ,
                                '0'
);







INSERT into graph_types     
(
                                id                                      ,
                                description                             ,
                                type                                    ,
                                graph1                          ,
                                graph2                          ,
                                sizex1                          ,
                                sizey1                          ,
                                sizex2                          ,
                                sizey2                          ,
                                allow_aggregation               
)

        VALUES
(
                                '12004'                                 ,
                                'Read Write Rate'                       ,
                                '12000'                                 ,
                                'GP_inf_64_rdrwrate'                    ,
                                ''                                      ,
                                '500'                                   ,
                                '175'                                   ,
                                '0'                                     ,
                                '0'                                     ,
                                '0'
);

cat <<EOF1 >> /opt/jffnms/engine/discovery/informant_64.inc.php

<?
/* SNMP Informant lDisk Discovery. 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 discovery_informant_64($ip, $community, $hostid, $param) {

        $interfaces = array();

        $SNMP_INFORMAT_MIB = ".1.3.6.1.4.1.9600.1.2";
        $lDiskEntry64_oid = $SNMP_INFORMAT_MIB.".44.1.1";

        if ($ip && $community && $hostid) {

            $DisksEntries64 = snmp_walk($ip, $community, $lDiskEntry64_oid, 
true);

             if (is_array($DisksEntries64))
                foreach ($DisksEntries64 as $oid=>$interface) {

                    $index = join(".",array_slice(explode(".",$oid),7));

                    $interfaces[$index] = array (
                        'interface' => $interface." Stats",
                        'oper' => "up"
                    );
                }
            else
                return false;
        }

        return $interfaces;
    }
?>


EOF1
cat << EOF1 >> GP_inf_64_totalque.inc.php

<?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));
    }

?>

EOF1



cat << EOF1 >> GP_inf_64_rdrwque.inc.php

<?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_rdrwque (\$data) {

        \$opts_DEF = 
rrdtool_get_def(\$data,array("rd_queue"=>"PN_inf64_queuel_avg_read","wr_queue"=>"PN_inf64_queuel_avg_write"));

        \$opts_GRAPH = array(
            "CDEF:ldisk_rate_total=rd_queue,wr_queue,+",
            "CDEF:wr_queue_graph=wr_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:rd_queue#0000CC:'RD. Disk Queue '",
            "GPRINT:rd_queue:MAX:'Max\:%8.2lf %s '",
            "GPRINT:rd_queue:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:rd_queue:LAST:'Last\:%8.2lf %s \\n'",

            "AREA:wr_queue_graph#FF0000:'WR. Disk Queue '",
            "GPRINT:wr_queue:MAX:'Max\:%8.2lf %s '",
            "GPRINT:wr_queue:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:wr_queue:LAST:'Last\:%8.2lf %s \\n'"
        );

        \$opts_header[] = "--vertical-label='RD/WR Disk Queue'";

        return array (\$opts_header, @array_merge(\$opts_DEF,\$opts_GRAPH));
    }

?>

EOF1






cat << EOF1 >> GP_inf_64_rdrwtime.inc.php

<?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_rdrwtime (\$data) {

        \$opts_DEF = 
rrdtool_get_def(\$data,array("rd_time"=>"PN_inf64_read_time","wr_time"=>"PN_inf64_write_time"));

        \$opts_GRAPH = array(
            "CDEF:ldisk_rate_total=rd_time,wr_time,+",
            "CDEF:wr_time_graph=wr_time,-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:rd_time#0000CC:'RD. Disk Time '",
            "GPRINT:rd_time:MAX:'Max\:%8.2lf %s '",
            "GPRINT:rd_time:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:rd_time:LAST:'Last\:%8.2lf %s \\n'",

            "AREA:wr_time_graph#FF0000:'WR. Disk Time '",
            "GPRINT:wr_time:MAX:'Max\:%8.2lf %s '",
            "GPRINT:wr_time:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:wr_time:LAST:'Last\:%8.2lf %s \\n'"
        );

        \$opts_header[] = "--vertical-label='RD/WR Disk Time'";

        return array (\$opts_header, @array_merge(\$opts_DEF,\$opts_GRAPH));
    }

?>

EOF1






cat << EOF1 >> GP_inf_64_rdrwrate.inc.php

<?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_rdrwrate (\$data) {

        \$opts_DEF = 
rrdtool_get_def(\$data,array("rd_rate"=>"PN_inf64_read_rate","wr_rate"=>"PN_inf64_write_rate"));

        \$opts_GRAPH = array(
            "CDEF:ldisk_rate_total=rd_rate,wr_rate,+",
            "CDEF:wr_rate_graph=wr_rate,-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:rd_rate#0000CC:'RD. Disk rate '",
            "GPRINT:rd_rate:MAX:'Max\:%8.2lf %s '",
            "GPRINT:rd_rate:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:rd_rate:LAST:'Last\:%8.2lf %s \\n'",

            "AREA:wr_rate_graph#FF0000:'WR. Disk rate '",
            "GPRINT:wr_rate:MAX:'Max\:%8.2lf %s '",
            "GPRINT:wr_rate:AVERAGE:'Average\:%8.2lf %s '",
            "GPRINT:wr_rate:LAST:'Last\:%8.2lf %s \\n'"
        );

        \$opts_header[] = "--vertical-label='RD/WR Disk rate'";

        return array (\$opts_header, @array_merge(\$opts_DEF,\$opts_GRAPH));
    }

?>

EOF1









-------------------------------------------------------------------------
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
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to