'.1.3.6.1.2.1.2.2.1.1', 'ifstatus' => '.1.3.6.1.2.1.2.2.1.8', 'ifdescription' => '.1.3.6.1.2.1.2.2.1.2', 'ifname' => '.1.3.6.1.2.1.31.1.1.1.1', 'ifalias' => '.1.3.6.1.2.1.31.1.1.1.18', 'iftype' => '.1.3.6.1.2.1.2.2.1.3', 'ifspeed' => '.1.3.6.1.2.1.2.2.1.5', 'ifHWaddress' => '.1.3.6.1.2.1.2.2.1.6', 'ifInOctets' => '.1.3.6.1.2.1.2.2.1.10', 'ifOutOctets' => '.1.3.6.1.2.1.2.2.1.16', ); $xml_delimiter = '!'; # all required input parms $hostname = $_SERVER['argv'][1]; $snmp_community = $_SERVER['argv'][2]; $snmp_version = $_SERVER['argv'][3]; $snmp_port = $_SERVER['argv'][4]; $snmp_timeout = $_SERVER['argv'][5]; $max_oids = $_SERVER['argv'][6]; # required for SNMP V3 $snmp_auth_username = $_SERVER['argv'][7]; $snmp_auth_password = $_SERVER['argv'][8]; $snmp_auth_protocol = $_SERVER['argv'][9]; $snmp_priv_passphrase = $_SERVER['argv'][10]; $snmp_priv_protocol = $_SERVER['argv'][11]; $snmp_context = $_SERVER['argv'][12]; $cmd = $_SERVER['argv'][13]; if (isset($_SERVER['argv'][14])) { $query_field = $_SERVER['argv'][14]; }; if (isset($_SERVER['argv'][15])) { $query_index = $_SERVER['argv'][15]; }; # ------------------------------------------------------------------------- # main code starts here # ------------------------------------------------------------------------- # ------------------------------------------------------------------------- # script MUST respond to index queries # the command for this is defined within the XML file as # index # you may replace the string 'index' both in the XML and here # ------------------------------------------------------------------------- # php -q