1 /* cyberpower-mib.c - data to monitor Cyberpower RMCARD
3 * Copyright (C) 2010 - Eric Schultz <paradxum@mentaljynx.com>
5 * derived (i.e. basically copied and modified) of bestpower by:
6 * Copyright (C) 2010 - Arnaud Quette <arnaud.quette@free.fr>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "cyberpower-mib.h"
27 #define CYBERPOWER_MIB_VERSION "0.1"
28 #define CYBERPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.3808.1.1.1.1.1.1.0"
30 #define CYBERPOWER_SYSOID ".1.3.6.1.4.1.3808"
32 static info_lkp_t cyberpower_power_status
[] = {
43 /* Snmp2NUT lookup table for CyberPower MIB */
44 static snmp_info_t cyberpower_mib
[] = {
46 { "device.type", ST_FLAG_STRING
, SU_INFOSIZE
, NULL
, "ups",
47 SU_FLAG_STATIC
| SU_FLAG_ABSENT
| SU_FLAG_OK
, NULL
, NULL
},
49 { "ups.mfr", ST_FLAG_STRING
, SU_INFOSIZE
, NULL
, "CYBERPOWER",
50 SU_FLAG_STATIC
| SU_FLAG_ABSENT
| SU_FLAG_OK
, NULL
, NULL
},
51 { "ups.model", ST_FLAG_STRING
, SU_INFOSIZE
, CYBERPOWER_OID_MODEL_NAME
,
52 "CyberPower", SU_FLAG_STATIC
, NULL
, NULL
},
54 { "ups.serial", ST_FLAG_STRING
, SU_INFOSIZE
, ".1.3.6.1.4.1.3808.1.1.1.1.2.3.0",
55 "", SU_FLAG_STATIC
, NULL
},
56 { "ups.firmware", ST_FLAG_STRING
, SU_INFOSIZE
, ".1.3.6.1.4.1.3808.1.1.1.1.2.1.0",
57 "", SU_FLAG_STATIC
, NULL
},
58 { "ups.mfr.date", ST_FLAG_STRING
, SU_INFOSIZE
, ".1.3.6.1.4.1.3808.1.1.1.1.2.2.0", "",
61 { "ups.status", ST_FLAG_STRING
, SU_INFOSIZE
, ".1.3.6.1.4.1.3808.1.1.1.4.1.1.0", "",
62 0 /*SU_STATUS_PWR*/, &cyberpower_power_status
[0] },
64 /* Battery runtime is expressed in minutes */
65 { "battery.runtime", 0, 60.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.4.0", "",
67 /* The elapsed time in seconds since the
68 * UPS has switched to battery power */
69 { "battery.runtime.elapsed", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.1.2.0", "",
71 { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.2.0", "",
73 { "battery.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.7.0", "",
76 /* end of structure. */
77 { NULL
, 0, 0, NULL
, NULL
, 0, NULL
, NULL
}
80 mib2nut_info_t cyberpower
= { "cyberpower", CYBERPOWER_MIB_VERSION
, "",
81 CYBERPOWER_OID_MODEL_NAME
, cyberpower_mib
, CYBERPOWER_SYSOID
};