Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

snmp with php linux

  • 24-03-2010 11:31PM
    #1
    Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭


    Hi,

    Im going insane trying to get snmp working with php on linux.

    I have xampp installed on my linux machine and i installed the php5-snmp module but no joy.

    any ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 378 ✭✭sicruise


    Surely that is an API for using snmp to communicate with a device that supports snmp... have you written any code? What device are you communicating with?


  • Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭mossy464


    I think iv figured it out. Just have to try it out when i go home. I need to install the net-snmp package also as php will need to communicate with it's libraries to basically understand snmp.

    I wrote some code alrite but it came back with fatal error: call to undefined function snmpget();


  • Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭mossy464


    Still no joy. I have installed net-snmp and thats working when I enter snmp commands from the terminal but not with php.

    Still fatal error. I followed the following link:

    http://ie2.php.net/manual/en/snmp.installation.php

    I have edited the config.h file but then it says to "compile PHP --with-snmp[=DIR]"

    I dont know how to do this. I am not the greatest with linux either.

    Any suggestions, iv been trying to get this working since early yesterday, its so annoying.


  • Registered Users, Registered Users 2 Posts: 6,652 ✭✭✭daymobrew


    [PHP]<?php
    phpinfo();
    ?>[/PHP] You should run this code to see how your XAMPP PHP is currently configured. SNMP may already be enabled.


  • Registered Users, Registered Users 2 Posts: 6,652 ✭✭✭daymobrew


    My XAMPP doesn't have it but the XAMPP forum seems to have a solution - by modifying a php.ini file.

    This link was result #4 in ask.com.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭mossy464


    daymobrew wrote: »
    My XAMPP doesn't have it but the XAMPP forum seems to have a solution - by modifying a php.ini file.

    This link was result #4 in ask.com.

    This is in windows im on linux. I found out i cant use xampp but i have to install php normally by downloading the source.

    I have done that and tried a
    ./configure --with-snmp=shared,/usr/local/include/net-snmp
    --enable-ucd-snmp-hack
    I get an error for --enable-ucd-snmp-hack command not found


  • Registered Users, Registered Users 2 Posts: 6,652 ✭✭✭daymobrew


    mossy464 wrote: »
    I have done that and tried a
    ./configure --with-snmp=shared,/usr/local/include/net-snmp
    --enable-ucd-snmp-hack
    I get an error for --enable-ucd-snmp-hack command not found
    It sounds like the --enable-ucd-snmp-hack is on a different line from the ./configure part. It should be all one command.
    ./configure --with-snmp=shared,/usr/local/include/net-snmp --enable-ucd-snmp-hack
    


  • Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭mossy464


    daymobrew wrote: »
    It sounds like the --enable-ucd-snmp-hack is on a different line from the ./configure part. It should be all one command.
    ./configure --with-snmp=shared,/usr/local/include/net-snmp --enable-ucd-snmp-hack
    

    Well i have it all in a shell script but i'll try that.

    Thanks daymo


  • Registered Users, Registered Users 2 Posts: 1,158 ✭✭✭mossy464


    mossy464 wrote: »
    Well i have it all in a shell script but i'll try that.

    Thanks daymo

    Well i tried what you said daymo and it seemed to help somewhat but still gave me an error.

    SNMP Sanity Check Error.

    Iv googled for this and cant find a definitive solution. Anyone have any ideas?


Advertisement