Ad Widget

Collapse

external command windows Batch trouble

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krusty_lab
    Junior Member
    • Jun 2011
    • 1

    #1

    external command windows Batch trouble

    Dear All,
    I'm trying to write an external check to monitor the currentdepth of an mq.
    I wrote cmd/dos script that returns the number of messages in the queue.

    If I run it by hand it gives me the right value, if I run it trough zabbix active check i get an error in the shel complaining that is not finding a file.


    the script look like:

    call c:\Zabbix\MQ-Check\Runmqsc-QL.bat

    type c:\Zabbix\MQ-Check\CURDEPTH.txt | c:\Windows\system32\find.exe "CURDEPTH" > c:\Zabbix\MQ-Check\CURDEPTH-TEMP.txt

    FOR /F "tokens=1-2 delims=()" %%A IN ('type c:\Zabbix\MQ-Check\CURDEPTH-TEMP.txt') DO (SET CTDP=%%B)
    echo %CTDP%

    I get the error, but only in zabbix, not if I run it by hand, on the second line the one stating "with type". stating : cannot find the file specified.

    why by hand it works and in zabbix not.

    zabbix is release 1.8.5

    regards

    Christian
Working...