'.1.3.6.1.4.1.4779.1.3.5.2.1.1', 'rpcName' => '.1.3.6.1.4.1.4779.1.3.5.2.1.2', 'cktCurrent1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.4.X.1', 'cktCurrent2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.4.X.2', 'cktCurrent3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.4.X.3', 'cktMaxCurrent1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.5.X.1', 'cktMaxCurrent2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.5.X.2', 'cktMaxCurrent3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.5.X.3', 'cktVoltage1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.6.X.1', 'cktVoltage2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.6.X.2', 'cktVoltage3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.6.X.3', 'cktPower1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.7.X.1', 'cktPower2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.7.X.2', 'cktPower3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.7.X.3', 'cktVA1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.8.X.1', 'cktVA2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.8.X.2', 'cktVA3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.8.X.3', 'cktCurrentAlmThresh1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.9.X.1', 'cktCurrentAlmThresh2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.9.X.2', 'cktCurrentAlmThresh3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.9.X.3', 'cktPowerFactor1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.10.X.1', 'cktPowerFactor2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.10.X.2', 'cktPowerFactor3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.10.X.3', 'cktPFAlmThresh1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.11.X.1', 'cktPFAlmThresh2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.11.X.2', 'cktPFAlmThresh3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.11.X.3', 'cktPFPowerThresh1' => '.1.3.6.1.4.1.4779.1.3.5.9.1.12.X.1', 'cktPFPowerThresh2' => '.1.3.6.1.4.1.4779.1.3.5.9.1.12.X.2', 'cktPFPowerThresh3' => '.1.3.6.1.4.1.4779.1.3.5.9.1.12.X.3', ]; $xml_delimiter = '!'; // all required input parms $hostname = $_SERVER['argv'][1]; // hostname/IP@ // $cmd = $_SERVER["argv"][2]; $snmp_community = $_SERVER['argv'][2]; $snmp_version = intval($_SERVER['argv'][3]); $snmp_port = intval($_SERVER['argv'][4]); $snmp_timeout = intval($_SERVER['argv'][5]); $max_oids = intval($_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]; } // get number of snmp retries from global settings $snmp_retries = intval(read_config_option('snmp_retries')); // ------------------------------------------------------------------------- // 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