php snmpget

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krzysztof

    php snmpget


    No one could answer my question lately, so maybe today I will have some luck :-)
    Here we go again:


    I noteced a weird problem with php snmpget. When I get two different consecutive
    queries from Cisco box (actualy, any box) and if the first returned value is not
    empty, but the second one is empty, then php shows exactly the same value for
    second snmpget as for the first one. If I perform snmpget from linux shell,
    everything is OK:

    from shell:

    [root]# snmpget 10.0.0.1 public sysName.0
    [root]# system.sysName. 0 = ruter1

    [root]# snmpget 10.0.0.1 public sysLocation.0
    [root]# system.sysLocat ion.0 =

    but with php:

    $a = snmpget('10.0.0 .1', 'public', 'sysName.0');
    $b = snmpget('10.0.0 .1', 'public', 'sysLocation.0' );

    echo "a = $a" => I get: a = ruter1

    echo "b = $b" => I get: b = ruter1

    Can anyone tell me why is that?

    PHP Version 4.3.2
    './configure' '--with-snmp'

    cheers,
    xal
  • ljb

    #2
    Re: php snmpget

    kzal-hates-spammers@pol.pl wrote:[color=blue]
    >...
    > I noteced a weird problem with php snmpget. When I get two different consecutive
    > queries from Cisco box (actualy, any box) and if the first returned value is not
    > empty, but the second one is empty, then php shows exactly the same value for
    > second snmpget as for the first one. If I perform snmpget from linux shell,
    > everything is OK:
    >...[/color]

    I can't duplicate this. My second response is empty, as it should be. Using
    php-4.3.8 but I doubt that matters. What version of SNMP are you using?

    Comment

    Working...