skipif.inc 459 B

123456789101112
  1. <?php
  2. extension_loaded('snmp') or die('skip snmp extension not available in this build');
  3. require_once (dirname(__FILE__).'/snmp_include.inc');
  4. //test server is available
  5. // this require snmpget to work ...
  6. //snmpget ( string $hostname , string $community ,
  7. //string $object_id [, int $timeout [, int $retries ]] )
  8. if (snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', $timeout) === false)
  9. die('skip NO SNMPD on this host or community invalid');