GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SNMP::PERSIST (3)

.ds Aq ’

NAME

SNMP::Persist - The SNMP pass_persist threaded backend

CONTENTS

VERSION

Version 0.05

SYNOPSIS



        use SNMP::Persist qw(&define_oid &start_persister &define_subtree);
        use strict;
        use warnings;


        #define base oid to host the subtree
        define_oid(".1.3.6.1.4.1.2021.248");

        #start the thread serving answers
        start_persister();

        #set first application number

        #loop forever to update the values
        while(1) {

          my %subtree;
          my $gameName;
          my $index=1;                                          #set first application number

          foreach $gameName ("game1", "game2") {                     #for each application
            $subtree{"1." . $index}=["INTEGER",$index];              #set game index data pair
            $subtree{"2." . $index}=["STRING",$gameName];            #set game name data pair
            $subtree{"3." . $index}=["Counter32", 344.2 ];           #set total memory data pair
            $index++;                                                #next application
          }

          #new values have arrived - notify the subtree controller
          define_subtree(\%subtree);

          #dont update for next 5 minutes
          sleep(300);
        }



The script can be used in the following way from snmpd.conf:

pass_persist .1.3.6.1.4.1.2021.248 <user script location>

DESCRIPTION

The SNMP-Persist module is a backend for pass_persist feature of net-snmp.

It simplifies the process of sharing user-specified data via SNMP and development of persistent net-snmp applications controlling a chosen MIB subtree.

It is particularly useful if data gathering process takes too long. The responder is a separate thread, which is not influenced by updates of MIB subtree data. The answer to a snmp request is fast and doesn’t rely on potentially slow source of data.

FUNCTIONS

define_subtree(\%hash)

Start the thread responsible for handling snmp requests. The function expects a reference to a predefined hash of arrays. Each array has to be built of two elements:
o data type

any SMI datatype supported by net-snmp (e.g. INTEGER, STRING, Counter32)

o value

a value set accordingly to the data type

define_oid($string)

Define the base oid for a mib subtree controlled by a script

start_persister( )

Create or update the subtree data

AUTHOR

Anna Wiejak, <anias at popoludnica.pl>

BUGS

Please report any bugs or feature requests to bug-snmp-persist at rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SNMP-Persist>. I will be notified, and then you’ll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.



    perldoc SNMP::Persist



You can also look for information at:
o AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/SNMP-Persist>

o CPAN Ratings

<http://cpanratings.perl.org/d/SNMP-Persist>

o RT: CPAN’s request tracker

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=SNMP-Persist>

o Search CPAN

<http://search.cpan.org/dist/SNMP-Persist>

COPYRIGHT & LICENSE

Copyright 2006 Anna Wiejak, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SNMP::PERSIST (3) 2007-02-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.