Node - Provide information on a generalized SNMP-enabled machine
use DBI; use Node;
my $dbh = new DBI->connect(...); my $node = new Node( id=>$machineID, dbHandle=>$dbh );
$node->SNMP( oid=>'temp5min' );
or
$node->SNMP( oid=>'temp5min', timestamp=>1 ); or
$node->SNMP( oid=>'cpu5min', value=>'5', timestamp=>'2004-07-16 18:28:01' );
print $node->id print $node->name print $node->description
Node contains the general information for a machine: server, interface,
router, bridge, etc. It supports only a few items that are common between
these machines. Its SNMP()
method can be used to access the
latest data or add new time-varying data (e.g. temperature, cpu
utilization). These data are related to the loopback interface of the
machine. Only loopback interfaces can have these data as these are not
actually related with the interface, but with the machine that owns the
loopback interface.
Node is meant to be a SUPER class, and not meant to be used directly. It provides a common method for mahines and interfaces to load/save data and provide the latest SNMP values. You cannot use Node to save anything.
new() - create a new node
dbHandle - database handle id - machine ID of the node
SNMP() - get or set SNMP data oid - numerical object ID name - textual object ID description - definition of this object ID timestamp* - date and time (yyyy-mm-dd hh:mm:ss) value - actual data
* - timestamp can also be used to get the timestamp, instead of the OID value, simply use timestamp=>1
id() - returns the id of the machine
name() - returns the name of the machine
description() - returns its description
Node will not return an error when you don't pass any parameter. Instead, it is set to an undefined value.
Node is supported as part of the core Pawikan distribution. Please send bug reports to <netapps@pregi.net> or use the bugzilla.
Jerremeo Raynier Gabás <ren@asti.dost.gov.ph>
Copyright (c) 2004 Philippine Research, Education and Government Information Network. All rights reserved. This program is part of the Pawikan Distribution; you can redistribute it and/or modify it under the same terms as Pawikan itself.