Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

snmp with php linux

Options
  • 24-03-2010 11:31pm
    #1
    Registered Users Posts: 1,127 ✭✭✭


    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 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 Posts: 1,127 ✭✭✭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 Posts: 1,127 ✭✭✭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 Posts: 6,509 ✭✭✭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 Posts: 6,509 ✭✭✭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 Posts: 1,127 ✭✭✭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 Posts: 6,509 ✭✭✭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 Posts: 1,127 ✭✭✭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 Posts: 1,127 ✭✭✭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