php-src/ext/snmp/tests
2011-06-12 11:58:49 +00:00
..
clean.inc
generic_timeout_error.phpt follow CS: 2011-03-20 20:07:33 +00:00
README
skipif.inc
snmp2_get.phpt
snmp2_getnext.phpt
snmp2_real_walk.phpt
snmp2_set-nomib.phpt follow CS: 2011-03-20 20:07:33 +00:00
snmp2_set.phpt * fix warning about redefining REGISTER_PDO_CLASS_CONST_LONG (damn copy'n'paste) 2011-03-04 18:58:01 +00:00
snmp2_walk.phpt * tune snmp2_walk.phpt 2011-03-04 19:23:25 +00:00
snmp3-error.phpt follow CS: 2011-03-20 20:07:33 +00:00
snmp3.phpt
snmp_get_quick_print.phpt
snmp_get_valueretrieval.phpt
snmp_getvalue.phpt
snmp_include.inc
snmp_read_mib.phpt
snmp_set_enum_print.phpt
snmp_set_oid_output_format.phpt
snmp-object-errno-errstr.phpt move SNMP VERSION constants into SNMP class itself 2011-06-12 11:58:49 +00:00
snmp-object-error.phpt move SNMP VERSION constants into SNMP class itself 2011-06-12 11:58:49 +00:00
snmp-object-properties.phpt move SNMP VERSION constants into SNMP class itself 2011-06-12 11:58:49 +00:00
snmp-object-setSecurity_error.phpt move SNMP VERSION constants into SNMP class itself 2011-06-12 11:58:49 +00:00
snmp-object.phpt move SNMP VERSION constants into SNMP class itself 2011-06-12 11:58:49 +00:00
snmpget.phpt
snmpgetnext.phpt
snmprealwalk.phpt
snmpset-nomib.phpt follow CS: 2011-03-20 20:07:33 +00:00
snmpset.phpt
snmpwalk.phpt
wrong_hostname.phpt fixed typos in tests 2011-05-10 20:04:26 +00:00

SNMP Tests
----------

To enable these tests, you must have :
- PHP compiled with SNMP (--with-snmp)
- an SNMP server running.


** How to test **
You need to give credentials with environment vars if default ones are not
sutable (see snmp_include.inc for more info):
SNMP_HOSTNAME : IP or IP:PORT to connect to
SNMP_COMMUNITY : community name
SNMP_COMMUNITY_WRITE : community used for write tests (snmpset()).
SNMP_MIBDIR : Directory containing MIBS

** Configuring the SNMPD server **

On Linux/FreeBSD
--------

- Install package net-snmpd (name may differ based on your distribution)
- Edit config file (by default this is /etc/snmp/snmpd.conf on Linux and
  usr/local/etc/snmp/snmpd.conf on FreeBSD) and replace whole content 
  with following lines:
  
###### Config file #####
rocommunity public 127.0.0.1
rwcommunity private 127.0.0.1

Do not enable them - being set here they make appropriate OID switch into r/o
#syslocation  "Somewhere in the world"
#syscontact  "root"

#SNMPv3 credentials
rouser adminMD5
rouser adminSHA
rwuser adminMD5AES
rouser adminMD5AES128
rouser adminMD5DES
createUser adminMD5 MD5 test1234
createUser adminSHA SHA test1234
createUser adminMD5AES MD5 test1234 AES test1234
createUser adminMD5AES128 MD5 test1234 AES test1234
createUser adminMD5DES MD5 test1234 DES test1234

createUser noAuthUser
authuser read noAuthUser noauth
###### End #####

Before launching daemon make sure that there is no file /var/net-snmp/snmpd.conf
Delete it if exists. Ingoring to to so will fail SNMPv3 tests

Make snmpd bind on localhost only. To do so, pass '127.0.0.1' into it's startup arguments
(see /etc/init.d/snmpd on Linux and set snmpd_flags="127.0.0.1" in rc.conf in FreeBSD).
Otherwise your SNMP daemon will answer SNMPv3 messages from remote clients.

- Launch snmpd (service snmpd start  or /etc/init.d/snmpd start)

On Windows
----------

[to be completed]