[Nut-upsdev] SNMP UPS: NETYS RT 1/1 UPS

Ing. Ján jan.ondrej at upjs.sk
Tue Oct 30 14:04:45 UTC 2012


Hello,

On Mon, Oct 29, 2012 at 08:49:03PM +0100, Arnaud Quette wrote:
> 2012/10/25 Ing. Ján <jan.ondrej at upjs.sk>
> On Wed, Oct 24, 2012 at 10:46:32PM +0200, Arnaud Quette wrote:
> > > for now, I'll need the output of the *exact* below commands:
> > > $ snmpget -v1 -c XXX 192.168.14.10 .1.3.6.1.2.1.1.2.0
> > > $ snmpwalk -On -v1 -c XXX 192.168.14.10 .1.3.6.1.4.1.2254.2.4
> > > $ snmpwalk -Os -v1 -c XXX 192.168.14.10 .1.3.6.1.4.1.2254.2.4
> > >
> > > the previous one was missing the -On (forced numeric paths), and I want
> > to
> > > have the 3 output taken at the same time.
> >
> > OK, output of this script attached:
> >
> > snmpget -v1 -c $C $IP .1.3.6.1.2.1.1.2.0 > /tmp/snmpget.log
> > snmpwalk -On -v1 -c $C $IP .1.3.6.1.4.1.2254.2.4 \
> >   | gzip > /tmp/snmpwalk-On.log.gz
> > snmpwalk -Os -v1 -c $C $IP .1.3.6.1.4.1.2254.2.4 \
> >   | gzip > /tmp/snmpwalk-Os.log.gz
> >
> 
> you'll find attached a first version of gen-snmp-subdriver.sh
> it still needs some more polishing and documentation, but should be usable.

OK, here are bugs (some of them maybe not important, but I will send all
found bugs):

./gen-snmp-subdriver.sh --help
...
 -m /path/to/file.mib -- location of the MIB definition file
...

and:

./gen-snmp-subdriver.sh -m test
Illegal option -m. Try --help for more info.

Can I define multiple MIB files with multiple arguments?

> note that I've only with mode2 (using your files), but got compiling the
> resulting files.
> it would be nice if you could test the live version (mode 1), and counter
> test mode 2.
> 
> from there, the mapping work is to be done. this is just an helper tool, to
> facilitate the creation of a new subdriver...

Ignoring -m parameter will create some files and write:

* add &netys_subdriver to snmp-ups.c:mib2nut[] list,

This is content of my netys-mib.h:

#ifndef NETYS_MIB_H
#define NETYS_MIB_H
#include "main.h"
#include "snmp-ups.h"
extern mib2nut_info_t netys;
#endif /* NETYS_MIB_H */

And compilation fails:

snmp-ups.c:69: error: ‘netys_subdriver’ undeclared here (not in a function)

Removing "_subdriver" will continut compiling.
Trying to run compiled driver:

[root at test drivers]# gdb ./snmp-ups
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/rpmbuild/BUILD/nut-2.6.4/drivers/snmp-ups...done.
(gdb) run -a local
Starting program: /root/rpmbuild/BUILD/nut-2.6.4/drivers/snmp-ups -a local
[Thread debugging using libthread_db enabled]
Network UPS Tools - Generic SNMP UPS driver 0.66 (2.6.4)
kill: No such process

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff75d305a in __strchr_sse2 () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.80.el6_3.5.x86_64 net-snmp-libs-5.5-41.el6_3.1.x86_64
openssl-1.0.0-25.el6_3.1.x86_64 zlib-1.2.3-27.el6.x86_64
(gdb) 

My ups.conf:

[local]
        driver = snmp-ups
        port = 192.168.xx.xx
        desc = "Socomec NETYS RT 2200VA SNMP"
        #mibs = netvision
        mibs = netys


				SAL



More information about the Nut-upsdev mailing list