Hello all,
I have exhausted my research and need a little help with some basic concepts.
First time configuration working with NUT and putting into a OS X environment.
Was able to install the package using Brew. Have read the documentation and have
been able to get the server running and agent running using MACOSX-UPS driver
and connect to UPS via USB. I would however like to integrate a TrippLite UPS
with TLNETCARD (IP management card). I see in the documentation that this may be
best accomplished using SNMP-UPS driver. However, I do not see the SNMP-UPS
drivers with the other drivers in the directory of drivers? It is not clear to
me if the Brew install does not provide this driver or if I am missing something
different in this concept? Should there be an actual executable file named
SNMP-UPS in the same directory with the other drivers?
I tried to look at the gist hub repos and dowloaded the snmp-ups (c and h)
files. When I try to make these under OS X 10.14, I get the errors below. (I
must admit here that I am not great at making executables so this may be
something obvious that I am missing in the build). Seems strange to me there
would be this many errors in the current code base unless I have a bad
configuration parameter or the code is not compatible with Mojave?
So I guess my questions at this point are as follows:
Can I simply download the already built SNMP-UPS executable driver from
somewhere that can be used on OS X Mojave 10.14? If so where is this available
from?
If I need to build my own executable, what am I missing or doing wrong that is
causing all of the errors in the build process?
Is the SNMP-UPS driver the best way to interact with a TrippLite IP based
TLNETCARD? If so do I need a sub-driver or anything more to make this work?
Any help and suggestions are greatly appreciated.
Best regards,
Dean
** errors from Make attempt below**
iMac5KSSD:~ deantrasente$ clang
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c -o snmp-ups -I
/Users/deantrasente/Documents/GitHub/nut/include -Wall
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:31:
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/varargs.h:25:4:
error: "Please use <stdarg.h> instead of <varargs.h>"
#error "Please use <stdarg.h> instead of <varargs.h>"
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:43:5: error: expected
parameter declarator
int snprintf (char *str, size_t count, const char *fmt, ...)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:39:
note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:43:5: error: expected
')'
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:39:
note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:43:5: note: to match
this '('
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:28:
note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:44:18: error:
'__format__' attribute parameter 2 is out of bounds
__attribute__ ((__format__ (__printf__, 3, 4)));
^ ~
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:43:5: error:
conflicting types for '__builtin___snprintf_chk'
int snprintf (char *str, size_t count, const char *fmt, ...)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:3:
note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:43:5: note:
'__builtin___snprintf_chk' is a builtin with type 'int (char *,
unsigned long, int, unsigned long, const char *, ...)'
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:3:
note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:48:5: error: expected
parameter declarator
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:75:40:
note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:48:5: error: expected
')'
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:75:40:
note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:48:5: note: to match
this '('
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:75:29:
note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:48:5: error:
conflicting types for '__builtin___vsnprintf_chk'
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:75:3:
note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:48:5: note:
'__builtin___vsnprintf_chk' is a builtin with type 'int (char *,
unsigned long, int, unsigned long, const char *, struct __va_list_tag *)'
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:75:3:
note: expanded from macro 'vsnprintf'
__builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)
^
In file included from
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:38:
In file included from /Users/deantrasente/Documents/GitHub/nut/drivers/main.h:4:
In file included from
/Users/deantrasente/Documents/GitHub/nut/include/common.h:45:
/Users/deantrasente/Documents/GitHub/nut/include/proto.h:55:19: error: static
declaration of 'setenv' follows non-static declaration
static inline int setenv(const char *name, const char *value, int overwrite) {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:237:6:
note: previous declaration is here
int setenv(const char * __name, const char * __value, int __overwrite)
__DARWIN_ALIAS(setenv);
^
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:783:10: warning:
assigning to 'char *' from 'u_char *' (aka 'unsigned char
*') converts between pointers to integer types with different sign
[-Wpointer-sign]
for(cp = pdu->variables->val.string, x = 0; x <
(int)pdu->variables->val_len; x++, cp++) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/deantrasente/Documents/GitHub/nut/drivers/snmp-ups.c:2911:46: error: use
of undeclared identifier 'CONFPATH'
snprintf(fn, sizeof(fn), "%s/snmp/%s.conf", CONFPATH, mib);
^
1 warning and 10 errors generated.
iMac5KSSD:~ deantrasente$
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20190122/8d91c0a3/attachment-0001.html>