Looks like owtcl problem (and no libusb)
If you aren't going to use owtcl, try
./configure --disable-owtcl

I'm perplexed by the owserver in background problem. Is it being loaded from the command line, or within the nagios system. Perhaps Nagios doesn't allow owserver to fork into the background?

Paul Alfille


On 11/4/06, Matt <[EMAIL PROTECTED]> wrote:

Hi,

I've been trying to integrate owfs with my Nagios (www.nagios.org)
installation at work this week and have had a few problems.

The system is Debian Sarge, kernel 2.6.8.

I run ./configure in the owfs-2.5p5 folder, this seems to complete ok.
Ends with :

Current configuration:

    Deployment location: /opt/owfs

Compile-time options:
                  Caching is enabled
                      USB is DISABLED
                      I2C is enabled
                   HA7Net is enabled
           Multithreading is enabled
    Parallel port DS1410E is enabled
        TAI8570 barometer is enabled
             Thermocouple is enabled
             Debug-output is enabled
                Profiling is DISABLED
       Zeroconf (Bonjour) is DISABLED

Module configuration:
        owfs is enabled
     owhttpd is enabled
      owftpd is enabled
    owserver is enabled
      owcapi is enabled
        swig is enabled
      owperl is enabled
       owphp is DISABLED
    owpython is enabled
       owtcl is DISABLED


Then I run `make`, which appears to chug along happily for a while and then
borks with the following :
make[4]: Entering directory `/root/owfs/owfs-2.5p5/module/swig/python'
/usr/bin/swig -python -o ow_wrap.c ../ow.i
python setup.py build
running build
running build_py
running build_ext
building '_OW' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPI                                                 C
-I../../owlib/src/include -I../../../src/include -I/usr/include/python2.3 -c
o                                                 w_wrap.c -o
build/temp.linux-i686-2.3/ow_wrap.o
ow_wrap.c:703: warning: function declaration isn't a prototype
ow_wrap.c:885: warning: function declaration isn't a prototype
ow_wrap.c:1288: warning: function declaration isn't a prototype
ow_wrap.c:1310: warning: function declaration isn't a prototype
ow_wrap.c:1350: warning: function declaration isn't a prototype
ow_wrap.c:1526: warning: function declaration isn't a prototype
ow_wrap.c:1749: warning: function declaration isn't a prototype
ow_wrap.c:214: warning: `SWIG_TypeDynamicCast' defined but not used
ow_wrap.c:402: warning: `SWIG_UnpackDataName' defined but not used
ow_wrap.c:472: warning: `SWIG_TypeClientData' defined but not used
ow_wrap.c:482: warning: `SWIG_PropagateClientData' defined but not used
ow_wrap.c:1181: warning: `SWIG_Python_MustGetPtr' defined but not used
ow_wrap.c:1195: warning: `SWIG_Python_ConvertPacked' defined but not used
ow_wrap.c:1860: warning: `SWIG_Python_addvarlink' defined but not used
gcc -pthread -shared build/temp.linux-i686-2.3/ow_wrap.o
-L../../owlib/src/c/.li                                                 bs
-Wl,-R/opt/owfs/lib -low -o build/lib.linux-i686-2.3/ow/_OW.so
make[4]: Leaving directory `/root/owfs/owfs-2.5p5/module/swig/python'
make[3]: Leaving directory `/root/owfs/owfs-2.5p5/module/swig/python'
Making all in tcl
make[3]: Entering directory `/root/owfs/owfs-2.5p5/module/swig/tcl'
sed -e '/^#/d' -e '/^$/d' -e 's/\"/\\"/g' -e 's/^/"/' -e 's/$/\\n"/' <ow.tcl
> o                                                 w.tcl.h || { /bin/rm
ow.tcl.h; exit 1; }
if /bin/sh ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
-I.                                                  -I../../../src/include
-I../../owlib/src/include -I ../../owcapi/src/include
-fexceptions -Wall -W -Wundef -Wshadow -Wpointer-arith -Wcast-qual
-Wcast-align
-Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_BITS=64
-DTCL_PACKAGE_PA                                                 TH=\"''\"
-DOWTCL_PACKAGE_PATH=\"/owtcl-0.1\" -g -O2 -pthread -MT ow.lo -MD -MP
-MF ".deps/ow.Tpo" -c -o ow.lo ow.c; \
then mv -f ".deps/ow.Tpo" ".deps/ow.Plo"; else rm -f ".deps/ow.Tpo"; exit 1;
fi
gcc -DHAVE_CONFIG_H -I. -I. -I../../../src/include
-I../../owlib/src/include -I
../../owcapi/src/include -fexceptions -Wall -W -Wundef -Wshadow
-Wpointer-arith                                                  -Wcast-qual
-Wcast-align -Wstrict-prototypes -Wredundant-decls -D_FILE_OFFSET_B
ITS=64 -DTCL_PACKAGE_PATH=\"\" -DOWTCL_PACKAGE_PATH=\"/owtcl-0.1\" -g -O2
-pthre                                                 ad -MT ow.lo -MD -MP
-MF .deps/ow.Tpo -c ow.c  -fPIC -DPIC -o .libs/ow.o
ow.c:14:17: tcl.h: No such file or directory
ow.c:39: error: syntax error before '*' token
ow.c:40: warning: function declaration isn't a prototype
ow.c: In function `owtcl_ErrorMsg':
ow.c:47: error: `Tcl_Obj' undeclared (first use in this function)
ow.c:47: error: (Each undeclared identifier is reported only once
ow.c:47: error: for each function it appears in.)
ow.c:47: error: `obj' undeclared (first use in this function)
ow.c:49: warning: implicit declaration of function `va_start'
ow.c:49: error: `format' undeclared (first use in this function)
ow.c:55: warning: implicit declaration of function `Tcl_NewStringObj'
ow.c:58: warning: implicit declaration of function `va_end'
ow.c:62: warning: implicit declaration of function `Tcl_SetObjResult'
ow.c:62: error: `interp' undeclared (first use in this function)
ow.c: At top level:
ow.c:65: error: syntax error before "clientData"
ow.c:66: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_Connect':
ow.c:67: error: `clientData' undeclared (first use in this function)
ow.c:70: error: `TCL_OK' undeclared (first use in this function)
ow.c:71: error: `objc' undeclared (first use in this function)
ow.c:71: warning: implicit declaration of function `Tcl_IncrRefCount'
ow.c:71: error: `objv' undeclared (first use in this function)
ow.c:74: error: `interp' undeclared (first use in this function)
ow.c:75: error: `TCL_ERROR' undeclared (first use in this function)
ow.c:78: warning: implicit declaration of function `Tcl_GetStringFromObj'
ow.c :78: warning: assignment makes pointer from integer without a cast
ow.c:89: warning: implicit declaration of function `Tcl_DecrRefCount'
ow.c: At top level:
ow.c:93: error: syntax error before "clientData"
ow.c:94: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_Delete':
ow.c:95: error: `clientData' undeclared (first use in this function)
ow.c:97: error: `interp' undeclared (first use in this function)
ow.c:98: error: `objc' undeclared (first use in this function)
ow.c:99: error: `objv' undeclared (first use in this function)
ow.c:104: error: `TCL_OK' undeclared (first use in this function)
ow.c: At top level:
ow.c:107: error: syntax error before "clientData"
ow.c:108: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_Put':
ow.c:109: error: `clientData' undeclared (first use in this function)
ow.c:112: error: `TCL_OK' undeclared (first use in this function)
ow.c:113: error: `objc' undeclared (first use in this function)
ow.c:113: error: `objv' undeclared (first use in this function)
ow.c:116: warning: implicit declaration of function `Tcl_AppendResult'
ow.c:116: error: `interp' undeclared (first use in this function)
ow.c:117: error: `TCL_ERROR' undeclared (first use in this function)
ow.c:122: warning: implicit declaration of function `Tcl_WrongNumArgs'
ow.c :129: warning: assignment makes pointer from integer without a cast
ow.c:132: warning: assignment makes pointer from integer without a cast
ow.c: At top level:
ow.c:149: error: syntax error before "clientData"
ow.c:150: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_Get':
ow.c:151: error: `clientData' undeclared (first use in this function)
ow.c:153: error: `TCL_OK' undeclared (first use in this function)
ow.c:155: error: `Tcl_Obj' undeclared (first use in this function)
ow.c:155: error: `resultPtr' undeclared (first use in this function)
ow.c:156: error: `objc' undeclared (first use in this function)
ow.c:156: error: `objv' undeclared (first use in this function)
ow.c:159: error: `interp' undeclared (first use in this function)
ow.c:160: error: `TCL_ERROR' undeclared (first use in this function)
ow.c:167: warning: assignment makes pointer from integer without a cast
ow.c :177: warning: assignment makes pointer from integer without a cast
ow.c:193: warning: implicit declaration of function `Tcl_NewListObj'
ow.c:196: warning: implicit declaration of function
`Tcl_ListObjAppendElement'
ow.c:200: warning: redundant redeclaration of `Tcl_ListObjAppendElement' in
same                                                  scope
ow.c:196: warning: previous declaration of `Tcl_ListObjAppendElement'
ow.c :200: warning: redundant redeclaration of `Tcl_NewStringObj' in same
scope
ow.c:196: warning: previous declaration of `Tcl_NewStringObj'
ow.c:202: warning: redundant redeclaration of `Tcl_NewStringObj' in same
scope
ow.c:196: warning: previous declaration of `Tcl_NewStringObj'
ow.c:205: warning: redundant redeclaration of `Tcl_NewStringObj' in same
scope
ow.c:196: warning: previous declaration of `Tcl_NewStringObj'
ow.c: At top level:
ow.c:214: error: syntax error before "clientData"
ow.c:215: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_Version':
ow.c:216: error: `clientData' undeclared (first use in this function)
ow.c:218: error: `Tcl_Obj' undeclared (first use in this function)
ow.c:218: error: `resultPtr' undeclared (first use in this function)
ow.c:222: error: `objc' undeclared (first use in this function)
ow.c:223: error: `objv' undeclared (first use in this function)
ow.c:227: error: `interp' undeclared (first use in this function)
ow.c:228: error: `TCL_OK' undeclared (first use in this function)
ow.c: At top level:
ow.c:231: error: syntax error before "clientData"
ow.c:232: warning: function declaration isn't a prototype
ow.c: In function `Owtcl_IsDir':
ow.c:233: error: `clientData' undeclared (first use in this function)
ow.c:237: error: `TCL_OK' undeclared (first use in this function)
ow.c:238: error: `Tcl_Obj' undeclared (first use in this function)
ow.c:238: error: `resultPtr' undeclared (first use in this function)
ow.c:240: error: `objc' undeclared (first use in this function)
ow.c:240: error: `objv' undeclared (first use in this function)
ow.c:243: error: `interp' undeclared (first use in this function)
ow.c:244: error: `TCL_ERROR' undeclared (first use in this function)
ow.c:257: warning: assignment makes pointer from integer without a cast
ow.c :264: warning: implicit declaration of function `Tcl_GetObjResult'
ow.c:266: warning: implicit declaration of function `Tcl_SetIntObj'
ow.c: At top level:
ow.c:300: error: syntax error before '*' token
ow.c:300: warning: function declaration isn't a prototype
ow.c: In function `Ow_Init':
ow.c:311: warning: implicit declaration of function `Tcl_PkgRequire'
ow.c:311: error: `interp' undeclared (first use in this function)
ow.c:313: warning: comparison between pointer and integer
ow.c:314: error: `TCL_ERROR' undeclared (first use in this function)
ow.c:324: warning: implicit declaration of function `Tcl_CreateObjCommand'
ow.c:324: error: `Tcl_ObjCmdProc' undeclared (first use in this function)
ow.c:324: error: syntax error before ')' token
ow.c:330: warning: implicit declaration of function `Tcl_CallWhenDeleted'
ow.c:331: error: `Tcl_InterpDeleteProc' undeclared (first use in this
function)
ow.c :331: error: syntax error before ')' token
ow.c:334: warning: implicit declaration of function `Tcl_PkgProvide'
ow.c:334: error: `TCL_OK' undeclared (first use in this function)
ow.c:342: warning: implicit declaration of function `Tcl_Eval'
ow.c:342: warning: implicit declaration of function `Tcl_IsSafe'
ow.c: At top level:
ow.c:356: error: syntax error before '*' token
ow.c:356: warning: function declaration isn't a prototype
ow.c: In function `Ow_SafeInit':
ow.c:359: error: `interp' undeclared (first use in this function)
make[3]: *** [ow.lo] Error 1
make[3]: Leaving directory `/root/owfs/owfs-2.5p5/module/swig/tcl'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/owfs/owfs- 2.5p5/module/swig'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/owfs/owfs-2.5p5/module'
make: *** [all-recursive] Error 1


After all that, I was able to run owserver and connect to a Link Hub.
If I run owserver with --forground, it's fine, I can access readings with
owread (which is great btw).
Running in background though, any attempt to owread results in owserver
unloading.

Not knowing how to fix all this, but still keen to make some progress, I had
a look at the python bindings.
I hacked together this script.

#! /usr/bin/env python

import ow
import sys

def main(argv=None):
    if argv is None:
      argv = sys.argv
    if len( argv ) < 2:
      print "usage: temperature.py serial_port_path ID temperature|humidity
CriticalLow WarningLow WarningHigh CriticalHigh"

      return 3
    else:
      ow.init(argv[1])
      sensor=ow.Sensor (argv[2])
      if argv[3]=="temperature":
        v=float(sensor.temperature)
      elif argv[3]=="humidity":
        v=float(sensor.humidity)

    if v>float(argv[7]) or v<float(argv[4]):
        print "CRITICAL: ", v
        return 2
    elif v>float(argv[6]) or v<float(argv[5]):
        print "WARNING: ", v
        return 1
    else :
        print "OK:", v
        return 0

if __name__ == "__main__":
    sys.exit(main())



This runs and works fine if I run it manually, but when nagios runs it
fails.
I narrowed it down to this line :

sensor=ow.Sensor(argv[2])

if I comment this out and fake the data it all works, nagios accepts the
results of the script.
With it in something fails.


Thanks for reading, sorry it's so long.

Matt

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to