snmp_get()

Discussion in 'Software' started by trp, Mar 11, 2010.

  1. trp

    trp Private E-2

    Can anyone tell me why the following code does not work (PHP):

    Code:
    		$current_ip = "192.168.1.100";
    		
    		$scan = snmpget($current_ip);
    		echo $scan;
    
    That is called on a form button click.. The IP exists on the network.

    Refer to this document:
    http://php.net/manual/en/function.snmpget.php

    Help?! :cry
     
  2. JJJIrish05

    JJJIrish05 Sergeant

    Well I think you're the one that needs to refer to the documentation, not us.

    string snmpget ( string $hostname , string $community , string $object_id [, int $timeout [, int $retries ]] )

    snmpget takes 3-5 arguments, not 1.

    Example: $syscontact = snmpget("127.0.0.1", "public", "system.SysContact.0");
     
  3. trp

    trp Private E-2

    I have cut out the other parts to try and eliminate complexity, having previously, and since your suggestion, run it with the arguements suggested..
    It still does not work.

    My reference to the php man pages were incase people did not understand, I have read it and tried nearly every suggested method.
     
  4. SWario

    SWario Sergeant

    Posting more complete code (like including the other parameters in the function) and what sort of error you are getting (if any) would be helpful in determining what might be wrong. It could be as simple as a misspelling or a missed quote or semi-colon, but we can't tell without seeing the context/error.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds