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

« back to all changes in this revision

Viewing changes to drivers/netvisionmib.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
/*  netvisionmib.h - data to monitor Socomec Sicon UPS equipped 
 
2
 *  with Netvision WEB/SNMP card/external box with NUT
 
3
 *
 
4
 *  Copyright (C) 2004
 
5
 *                      Thanos Chatziathanassiou <tchatzi@arx.net>
 
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 NETVISION_MIB_VERSION                   "0.1"
 
25
 
 
26
/* SNMP OIDs set */
 
27
#define NETVISION_OID_UPS_MIB                   ".1.3.6.1.4.1.4555.1.1.1.1"
 
28
#define NETVISION_OID_UPSIDENTMODEL             ".1.3.6.1.4.1.4555.1.1.1.1.1.1"
 
29
#define NETVISION_OID_UPSIDENTFWVERSION         ".1.3.6.1.4.1.4555.1.1.1.1.1.2"
 
30
#define NETVISION_OID_UPSIDENTAGENTSWVERSION    ".1.3.6.1.4.1.4555.1.1.1.1.1.3"
 
31
#define NETVISION_OID_UPSIDENTUPSSERIALNUMBER   ".1.3.6.1.4.1.4555.1.1.1.1.1.4"
 
32
 
 
33
/* UPS Battery */
 
34
#define NETVISION_OID_BATTERYSTATUS             ".1.3.6.1.4.1.4555.1.1.1.1.2.1"
 
35
info_lkp_t netvision_batt_info[] = {
 
36
        { 2, "OL" }, /* battery normal */
 
37
        { 3, "LB" }, /* battery low */
 
38
        { 4, "LB" }, /* battery depleted */
 
39
        { 5, "OB" }, /* battery discharging */
 
40
        { 6, "RB" }  /* battery failure */
 
41
};
 
42
 
 
43
#define NETVISION_OID_SECONDSONBATTERY          ".1.3.6.1.4.1.4555.1.1.1.1.2.2"
 
44
#define NETVISION_OID_BATT_RUNTIME_REMAINING    ".1.3.6.1.4.1.4555.1.1.1.1.2.3"
 
45
#define NETVISION_OID_BATT_CHARGE               ".1.3.6.1.4.1.4555.1.1.1.1.2.4"
 
46
#define NETVISION_OID_BATT_VOLTS                ".1.3.6.1.4.1.4555.1.1.1.1.2.5"
 
47
 
 
48
#define NETVISION_OID_INPUT_NUM_LINES           ".1.3.6.1.4.1.4555.1.1.1.1.3.1.0" /* 1phase or 3phase UPS input */
 
49
#define NETVISION_OID_OUTPUT_NUM_LINES          ".1.3.6.1.4.1.4555.1.1.1.1.4.3.0" /* 1phase or 3phase UPS output */
 
50
 
 
51
/* 
 
52
        three phase ups provide input/output/load for each phase 
 
53
        in case of one-phase output, only _P1 should be used
 
54
*/
 
55
 
 
56
#define NETVISION_OID_OUT_VOLTAGE_P1    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.2"
 
57
#define NETVISION_OID_OUT_CURRENT_P1    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.3"
 
58
#define NETVISION_OID_OUT_LOAD_PCT_P1   ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.4"
 
59
#define NETVISION_OID_IN_VOLTAGE_P1     ".1.3.6.1.4.1.4555.1.1.1.1.3.3.1.5"
 
60
 
 
61
#define NETVISION_OID_OUT_VOLTAGE_P2    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.2.2"
 
62
#define NETVISION_OID_OUT_CURRENT_P2    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.3.2"
 
63
#define NETVISION_OID_OUT_LOAD_PCT_P2   ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.4.2"
 
64
#define NETVISION_OID_IN_VOLTAGE_P2     ".1.3.6.1.4.1.4555.1.1.1.1.3.3.1.5.2"
 
65
 
 
66
#define NETVISION_OID_OUT_VOLTAGE_P3    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.2.3"
 
67
#define NETVISION_OID_OUT_CURRENT_P3    ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.3.3"
 
68
#define NETVISION_OID_OUT_LOAD_PCT_P3   ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.4.3"
 
69
#define NETVISION_OID_IN_VOLTAGE_P3     ".1.3.6.1.4.1.4555.1.1.1.1.3.3.1.5.3"
 
70
 
 
71
#define NETVISION_OID_OUTPUT_SOURCE     ".1.3.6.1.4.1.4555.1.1.1.1.4.1.0"
 
72
info_lkp_t netvision_output_info[] = {
 
73
        { 1, "NULL" },   /* output source other   */
 
74
        { 2, "NULL" },   /* output source none    */
 
75
        { 3, "OL" },     /* output source normal  */
 
76
        { 4, "BYPASS" }, /* output source bypass  */
 
77
        { 5, "OB" },     /* output source battery */
 
78
        { 6, "BOOST" },  /* output source booster */
 
79
        { 7, "TRIM" },   /* output source reducer */
 
80
        { 8, "NULL" },   /* output source standby */
 
81
        { 9, "NULL" },   /* output source ecomode */
 
82
};
 
83
 
 
84
/* Snmp2NUT lookup table */
 
85
snmp_info_t netvision_mib[] = {
 
86
        { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTAGENTSWVERSION, "SOCOMEC SICON UPS",
 
87
                SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
88
        { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTMODEL,
 
89
                "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
90
        { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTUPSSERIALNUMBER, "",
 
91
                SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
92
        { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTFWVERSION, "",
 
93
                SU_FLAG_STATIC | SU_FLAG_OK, NULL },
 
94
        { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_BATTERYSTATUS, "",
 
95
                SU_FLAG_OK | SU_STATUS_BATT, &netvision_batt_info[0] },
 
96
        
 
97
        /* ups load */
 
98
        { "ups.load", 0, 1, NETVISION_OID_OUT_LOAD_PCT_P1, 0, SU_FLAG_OK, NULL },
 
99
        
 
100
        /*ups input,output voltage, output frquency phase 1 */
 
101
        { "input.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P1, 0, SU_FLAG_OK, NULL },
 
102
        { "output.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P1, 0, SU_FLAG_OK, NULL },
 
103
        { "output.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P1, 0, SU_FLAG_OK, NULL },
 
104
        
 
105
        /* battery info */
 
106
        { "battery.charge", 0, 1, NETVISION_OID_BATT_CHARGE, "", SU_FLAG_OK, NULL },
 
107
        { "battery.voltage", 0, 0.1, NETVISION_OID_BATT_VOLTS, "", SU_FLAG_OK, NULL },
 
108
        { "battery.runtime", 0, 60, NETVISION_OID_BATT_RUNTIME_REMAINING, "", SU_FLAG_OK, NULL },
 
109
        
 
110
        /* end of structure. */
 
111
        { NULL, 0, 0, NULL, NULL, 0, NULL }
 
112
};