Thanks, now I started getting messages from the list.

As you advised, I renamed the mib file NETCARD.mib to Tripplite and ran
command

./gen-snmp-subdriver.sh -H 10.200.254.39 -c public -n Tripplite

Here is what it says:

snmp_build: unknown failuresnmpget: Error building ASN.1 representation
(Can't build OID for variable)
COUNT = 0 / 0
Creating tripplite-mib.h
Creating tripplite-mib.c
Done.

The output files are attached, but I think it is not succeeding to create
the subdriver, as tripplite-mib.c contains very few code and doesn't seem
to have necessary code.

I tried the "mode 1", since the "mode 2" wasn't really working for me: when
I run command

snmpwalk -On -c public 10.200.254.39 .1.3.6.1.4.1.935

It says:
snmpwalk: Timeout (msgGlobalData header type A2: s/b 30)

But snmpget of a certain parameter works fine and we are currently able to
monitor it through Zabbix's snmp:
snmpget -v 1 -c public 10.200.254.39 .1.3.6.1.4.1.935.1.1.1.4.1.1

Output shows the correct value of status:
XPPC-MIB::upsBaseOutputStatus.0 = INTEGER: onLine(2)

If it is possible for you, could you please run it from your pc in "mode 2"
that doesn't require direct access to device (mib file is attached)?

Thanks in advance,

Ishi






On Mon, Feb 10, 2014 at 8:56 PM, Charles Lepple <[email protected]> wrote:

> On Feb 10, 2014, at 1:16 AM, Иши Кылса wrote:
>
> Thanks for you reply. Concerning the subscribtion list, I have earlier
> filled in the fields and sent request to subscribe to this list, but still
> haven't got an answer.
>
>
> I added you manually, but check your spam folder just in case it ended up
> there.
>
> Yes, I do have a MIB file that was on CD that came with the UPS, attached
> it to this message.
>
> Thanks for the link, started following it and at the step concerning
> runninh script scripts/subdriver/gen-snmp-subdriver.sh downloaded
> the archive nut-2.6.2.tar.gz but there is no
> script gen-snmp-subdriver.sh in it, only file path-to-subdriver.sh in
> directory scripts/subdriver/. Then through google found the
> script gen-snmp-subdriver.sh and put in directory scripts/subdriver/ and
> ran it:
>
>
> Hmm, we'll have to add that to the distribution.
>
> Not sure what Google found, but this is generally where the latest version
> is kept:
>
>
> https://github.com/networkupstools/nut/blob/master/scripts/subdriver/gen-snmp-subdriver.sh
>
> For now, I am putting fixes on this branch:
>
>
> https://github.com/networkupstools/nut/blob/snmp_subdriver/scripts/subdriver/gen-snmp-subdriver.sh
>
> Can you try the version from the second link? (use the "Raw" button to
> download the script itself)
>
> ./gen-snmp-subdriver.sh -H 10.200.254.39 -c public -n NETCARD.mib
>
>
> I would recommend using "-n TrippLite" or similar, since the rest of the
> MIB names are company names rather than product names. Also, the name needs
> to be a valid C identifier (alphanumeric).
>
> snmp_build: unknown failuresnmpget: Error building ASN.1 representation
> (Can't build OID for variable)
> COUNT = 0 / 0
> Creating netcard.mib-mib.h
> Creating netcard.mib-mib.c
> Done.
>
> Do not forget to:
> * bump DRIVER_VERSION in snmp-ups.c (add "0.01")
> * copy "netcard.mib-mib.h" and "netcard.mib-mib.c" to "../../drivers"
> * add #include "netcard.mib-mib.h" to snmp-ups.c
> * add &netcard.mib to snmp-ups.c:mib2nut[] list,
> * add netcard.mib-mib.c to snmp_ups_SOURCES in drivers/Makefile.am
> * add netcard.mib-mib.h to dist_noinst_HEADERS in drivers/Makefile.am
> * copy netcard.mib-mib.c and netcard.mib-mib.h to ../drivers/
> * "autoreconf && configure && make" from the top level directory
>
> Does it mean it is ok?
>
>
> --
> Charles Lepple
> clepple@gmail
>
>
>
>

Attachment: Tripplite
Description: Binary data

/* tripplite-mib.c - subdriver to monitor Tripplite SNMP devices with NUT
 *
 *  Copyright (C)
 *  2011 - 2012	Arnaud Quette <[email protected]>
 *
 *  Note: this subdriver was initially generated as a "stub" by the
 *  gen-snmp-subdriver script. It must be customized!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include "tripplite-mib.h"

#define TRIPPLITE_MIB_VERSION  "0.1"

#define TRIPPLITE_SYSOID       ""

/* To create a value lookup structure (as needed on the 2nd line of the example
 * below), use the following kind of declaration, outside of the present snmp_info_t[]:
 * static info_lkp_t onbatt_info[] = {
 * 	{ 1, "OB" },
 * 	{ 2, "OL" },
 * 	{ 0, "NULL" }
 * };
 */

/* TRIPPLITE Snmp2NUT lookup table */
static snmp_info_t tripplite_mib[] = {

	/* Data format:
	 * { info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar },
	 *
	 *	info_type:	NUT INFO_ or CMD_ element name
	 *	info_flags:	flags to set in addinfo
	 *	info_len:	length of strings if STR
	 *				cmd value if CMD, multiplier otherwise
	 *	OID: SNMP OID or NULL
	 *	dfl: default value
	 *	flags: snmp-ups internal flags (FIXME: ...)
	 *	oid2info: lookup table between OID and NUT values
	 *	setvar: variable to set for SU_FLAG_SETINT
	 *
	 * Example:
	 * { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL },
	 * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, onbatt_info },
	 *
	 * To create a value lookup structure (as needed on the 2nd line), use the
	 * following kind of declaration, outside of the present snmp_info_t[]:
	 * static info_lkp_t onbatt_info[] = {
	 * 	{ 1, "OB" },
	 * 	{ 2, "OL" },
	 * 	{ 0, "NULL" }
	 * };
	 */

	/* end of structure. */
	{ NULL, 0, 0, NULL, NULL, 0, NULL }
};

mib2nut_info_t	tripplite = { "tripplite", TRIPPLITE_MIB_VERSION, NULL, NULL, tripplite_mib, TRIPPLITE_SYSOID };
/* tripplite-mib.h - subdriver to monitor Tripplite SNMP devices with NUT
 *
 *  Copyright (C)
 *  2011 - 2012	Arnaud Quette <[email protected]>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef TRIPPLITE_MIB_H
#define TRIPPLITE_MIB_H

#include "main.h"
#include "snmp-ups.h"

extern mib2nut_info_t tripplite;

#endif /* TRIPPLITE_MIB_H */
_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to