~ubuntu-branches/debian/stretch/jffnms/stretch

« back to all changes in this revision

Viewing changes to engine/pollers/snmp_ibm_power.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2012-05-27 17:25:29 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120527172529-w0bkk0qo3jz8vkhx
Tags: 0.9.3-1
* New upstream release
* Adjusted configurations for new apache standard Closes: #669853
* Removed orphan files Closes: #672385
* Generate valid DB config
* Fixup default config files Closes: #655654

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * Copyright (C) <2002-2005> David LIMA <dlima@fr.scc.com> 
4
4
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
5
5
 */
6
 
function poller_snmp_ibm_power ($options) {
7
 
        extract($options);
 
6
function poller_snmp_ibm_power ($options)
 
7
{
 
8
    $oid = $options['poller_parameters'];
 
9
    if (empty($options['ro_community']))
 
10
        return FALSE;
8
11
 
9
 
        $oid = $poller_parameters;
10
 
        if ($ro_community) { //dont do anything if we dont have the community
11
 
            $value2 =  (snmp_get($host_ip,$ro_community,$oid));
12
 
            preg_match('{(\d+)}',$value2,$value);
13
 
        }
14
 
        return $value[1];
 
12
    $snmp_value =  (snmp_get($options['host_ip'],$options['ro_community'],$oid));
 
13
    if ( preg_match('{(\d+)}',$snmp_value,$matches))
 
14
        return $matches[1];
 
15
    return FALSE;
15
16
}
16
17
?>