~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to drivers/pwmib.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-07-20 19:48:50 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050720194850-oo61wjr33rrx2mre
Tags: upstream-2.0.2
ImportĀ upstreamĀ versionĀ 2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  pwmib.h - data to monitor Powerware UPS with NUT
 
2
 *  (using MIBs described in stdupsv1.mib and Xups.mib)
 
3
 *
 
4
 *  Copyright (C) 2005
 
5
 *                      Olli Savia <ops@iki.fi>
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with this program; if not, write to the Free Software
 
20
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
21
 *
 
22
 */
 
23
 
 
24
#define PW_MIB_VERSION                   "0.1"
 
25
 
 
26
#define PW_OID_MANUFACTURER              ".1.3.6.1.2.1.33.1.1.1"
 
27
#define PW_OID_MODEL                     ".1.3.6.1.2.1.33.1.1.2"
 
28
#define PW_OID_SOFTWARE_VERSION          ".1.3.6.1.2.1.33.1.1.3"
 
29
#define PW_OID_AGENT_SOFTWARE_VERSION    ".1.3.6.1.2.1.33.1.1.4"
 
30
 
 
31
#define PW_OID_BATTERY_STATUS            ".1.3.6.1.4.1.534.1.2.5" /* Xups.mib */
 
32
#define PW_OID_BATTERY_MINUTES_REMAINING ".1.3.6.1.2.1.33.1.2.3"
 
33
#define PW_OID_BATTERY_CHARGE_REMAINING  ".1.3.6.1.2.1.33.1.2.4"
 
34
#define PW_OID_BATTERY_VOLTAGE           ".1.3.6.1.2.1.33.1.2.5"
 
35
 
 
36
#define PW_OID_IN_FREQUENCY              ".1.3.6.1.2.1.33.1.3.3.1.2"
 
37
#define PW_OID_IN_VOLTAGE                ".1.3.6.1.2.1.33.1.3.3.1.3"
 
38
 
 
39
#define PW_OID_OUT_FREQUENCY             ".1.3.6.1.2.1.33.1.4.2"
 
40
#define PW_OID_OUT_VOLTAGE               ".1.3.6.1.2.1.33.1.4.4.1.2"
 
41
#define PW_OID_OUT_CURRENT               ".1.3.6.1.2.1.33.1.4.4.1.3"
 
42
#define PW_OID_OUT_POWER                 ".1.3.6.1.2.1.33.1.4.4.1.4"
 
43
#define PW_OID_OUT_PERCENTLOAD           ".1.3.6.1.2.1.33.1.4.4.1.5"
 
44
 
 
45
#define PW_OID_AMBIENT_TEMP              ".1.3.6.1.4.1.534.1.6.1" /* Xups.mib */
 
46
 
 
47
 
 
48
/* Defines for PW_OID_BATTERY_STATUS */
 
49
info_lkp_t pw_batt_info[] = {
 
50
        { 1, "CHARGING" },
 
51
        { 2, "DISCHARGING" },
 
52
        { 3, "FLOATING" },
 
53
        { 4, "RESTING" },
 
54
        { 5, "UNKNOWN" },
 
55
        { 0, "NULL" }
 
56
} ;
 
57
 
 
58
 
 
59
/* Snmp2NUT lookup table */
 
60
 
 
61
snmp_info_t pw_mib[] = {
 
62
        /* UPS page */
 
63
        { "ups.firmware",        ST_FLAG_STRING, SU_INFOSIZE, PW_OID_SOFTWARE_VERSION,          "", SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
64
        { "ups.firmware.aux",    ST_FLAG_STRING, SU_INFOSIZE, PW_OID_AGENT_SOFTWARE_VERSION,    "", SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
65
        { "ups.load",            0,              1.0,         PW_OID_OUT_PERCENTLOAD,           "", SU_FLAG_OK,                  NULL },
 
66
        { "ups.mfr",             ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MANUFACTURER,              "", SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
67
        { "ups.model",           ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MODEL,                     "", SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
68
        { "ups.power",           0,              1.0,         PW_OID_OUT_POWER,                 "", SU_FLAG_OK,                  NULL },
 
69
        { "ups.status",          ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATTERY_STATUS,            "", SU_FLAG_OK | SU_STATUS_BATT, &pw_batt_info[0] },
 
70
        /* Battery page */
 
71
        { "battery.charge",      0,              1.0,         PW_OID_BATTERY_CHARGE_REMAINING,  "", SU_FLAG_OK,                  NULL },
 
72
        { "battery.runtime",     0,              60.0,        PW_OID_BATTERY_MINUTES_REMAINING, "", SU_FLAG_OK,                  NULL },
 
73
        { "battery.voltage",     0,              0.1,         PW_OID_BATTERY_VOLTAGE,           "", SU_FLAG_OK,                  NULL },
 
74
        /* Output page */
 
75
        { "output.current",      0,              1.0,         PW_OID_OUT_CURRENT,               "", SU_FLAG_OK,                  NULL },
 
76
        { "output.frequency",    0,              0.1,         PW_OID_OUT_FREQUENCY,             "", SU_FLAG_OK,                  NULL },
 
77
        { "output.voltage",      0,              1.0,         PW_OID_OUT_VOLTAGE,               "", SU_FLAG_OK,                  NULL },
 
78
        /* Input page */
 
79
        { "input.frequency",     0,              0.1,         PW_OID_IN_FREQUENCY,              "", SU_FLAG_OK,                  NULL },
 
80
        { "input.voltage",       0,              1.0,         PW_OID_IN_VOLTAGE,                "", SU_FLAG_OK,                  NULL },
 
81
        /* Ambient page */
 
82
        { "ambient.temperature", 0,              1.0,         PW_OID_AMBIENT_TEMP,              "", SU_FLAG_OK,                  NULL },
 
83
        /* end of structure. */
 
84
        { NULL, 0, 0, NULL, NULL, 0, NULL }
 
85
} ;