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  -  NET::SNMP::UTIL::TC (3)

.ds Aq ’

NAME

Net::SNMP::Util::TC - Giving Textual Convention of MIBs

CONTENTS

SYNOPSIS



    use Net::SNMP::Util;
    use Net::SNMP::Util::OID qw(if*);
    use Net::SNMP::Util::TC qw(updown iftype);

    $r = snmpget(
        snmp => { -hostname => $host },
        oids => { map oidp("$_.1"), qw/ifName ifType ifAdminStatus ifOperStatus/ }
    );
    my $tc = Net::SNMP::Util::TC->new();

    printf "port:%s index:%d type:%s astat:%s ostat:%s\n",
        $r->{"ifName.1"}, $index, $tc->ifType($r->{"ifType.1"}),
            updown($r->{"ifAdminStatus.1"}),
            updown($r->{"ifOperStatus.1" });



DESCRIPTION

Module Net::SNMP::Util::TC gives the way to convert some MIB values to humans recognizable text.

EXPORT

This module, Net::SNMP::Util::OID, exports isup() and updown() defalut which are for ifAdminStatus and ifOperStatus to check up or down simply.

To know status, kind or type fully, make object first and than call method with MIB value to convert like below;



    $tc = Net::SNMP::Util::TC->new();
    $status = $tc->ifAdminStatus($value);



FUNCTIONS

isup()



    isup( $value );



If $value is 1, function returns 1. If values else this returns 0.

updown()



    updown( $value );



If $value is 1, function returns string ’up’. Else returns ’down’.

METHODS

new()



    $tc = Net::SNMP::Util::TC->new();



First creat an object for conversion. No arguments are need for this class. Then call method, which name is same as MIB name, with passing value you want to convert. e.g.;



    $type = $tc->ifType( 132 );     # "coffee"



    Avaiable Methods

Textual conversion methods now avaiable are;
ifAdminStatus() For conversion value of MIB ifAdminStatus.
ifOperStatus() For conversion value of MIB ifOperStatus.
ifType() For conversion value of MIB ifType. MIB ifType is now defined as IANAifType.
ifRcvAddressType() For conversion value of MIB ifRcvAddressType.
TruthValue() For conversion value of MIB TruthValue.
StorageType() For conversion value of MIB StorageType.

METHODS

TRUE()

This method always returns 1 which is defined as true value in MIB TruthValue at RFC-1903.

FALSE()

This method always returns 2 which is defined as false value in MIB TruthValue at RFC-1903.

AUTHOR

t.onodera, <cpan :: garakuta.net>

SEE ALSO

Net::SNMP::Util, Net::SNMP::Util::OID

LICENSE AND COPYRIGHT

Copyright(C) 2010 Takahiro Ondoera.

This program is free software; you may redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

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


perl v5.20.3 NET::SNMP::UTIL::TC (3) 2011-02-17

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