Git Product home page Git Product logo

php-snmp's People

Contributors

urban-1 avatar xslim avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

urban-1 ario92

php-snmp's Issues

Issue with oid if the integer is greater than 16383

When I have provided '1.3.6.1.4.1.28319.10.2.2' in oid then it is converted to '1.3.6.1.4.1.11935.10.2.2' while sending to the snmp trap.

Example variable:

$vars[] = packVarBind(array('oid' => '1.3.6.1.4.1.28319.10.2.2',
'value' => 'sample',
'type' => 'o'
));

While debugging, I found that if the value in oid is greater than 16384 then it is being reset from 0 so I am unable to receive the actual oid on the snmp trap.

So the oid value should be the same while sending from php and on receiving on snmp trap end.

Please let me know if I need to set any configuration while sending the snmp trap.

Backward compatibility issue?

What steps will reproduce the problem?
1. php SNMP.php
2. use PHP/4.3.11
3.

What is the expected output? What do you see instead?
back to prompt ( I think ) when it works properly.  I am currently
recieving this error:

PHP Parse error:  parse error, unexpected T_STRING, expecting
T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in
/var/www/html/snmp_monitor/SNMP4.php on line 30

Line 30:
public static function trap($ip, $varBinds=null, $community='public')

Can this code not be used on this old of a version of PHP?

What version of the product are you using? On what operating system?
Centos 4

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Oct 2009 at 8:42

Is this working?

Hi all,

Can anyone confirm that the code in this repo is working? I know it is not maintained but is the packing correct? If not, are there any alternatives?

Cheers

Is not working due to some bugs

What steps will reproduce the problem?
1. Calling SNMP::trap() is not working

What version of the product are you using? On what operating system?
Debian, Lenny

Please provide any additional information below.
Bugs in SNMP.php

Line: 80
$trap is not exists, should be $pSnmp

Line: 91
$trapPacket is not exists, should be $snmpPacket

Proposals:
All functions shoul be part od class.
SNMPTrap is better name for class.

Impreved hexlen:
    public static function hexlen( $s ) 
    {
        $len     = strlen( $s );
        $hexlen  = self::dec2hex( $len );
        $keyByte = ""; 

        if( $len > 127 ){
          $lenBytes = strlen( $hexlen ) / 2;
          $keyByte = self::dec2hex( 0x80 + $lenBytes );
        }

        return $keyByte . $hexlen;
    }






Original issue reported on code.google.com by [email protected] on 2 Oct 2009 at 5:07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.