the OID is ifAdminStatus.

$ snmptranslate -IR -Td ifAdminStatus IF-MIB::ifAdminStatus ifAdminStatus OBJECT-TYPE -- FROM IF-MIB, RFC1213-MIB SYNTAX INTEGER { up(1), down(2), testing(3) } MAX-ACCESS read-write STATUS current DESCRIPTION "The desired state of the interface. The testing(3) s +tate indicates that no operational packets can be passed. When + a managed system initializes, all interfaces start with ifAdminStatus in the down(2) state. As a result of either explicit management action or per configuration informatio +n retained by the managed system, ifAdminStatus is then changed to either the up(1) or testing(3) states (or remai +ns in the down(2) state)." ::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) interfaces(2) +ifTable(2) ifEntry(1) 7 }

this will turn a port off...

$ snmpset $ARGS $HOST .1.3.6.1.2.1.2.2.1.7.$PORT i 2

set back to '1' to turn it back on.


In reply to Re: query a MAC address by zengargoyle
in thread query a MAC address by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.