Ad Widget

Collapse

Windows agent UserParameter result different than command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pablitko
    Junior Member
    • Nov 2020
    • 8

    #1

    Windows agent UserParameter result different than command line

    I created console application in AutoIt to check whether application is responding or not:
    Once I run it in command line the result is correct but if I'm running it via Zabbix agent the result is different.
    What can be the reason?

    AutoIt code
    Code:
    #AutoIt3Wrapper_Change2CUI=Y
    #include <WinAPISysWin.au3>
    $result = ""
    $isWindowHang=""
    $hwnd = WinGetHandle("App name")
    
    If $hwnd = 0 Then
        $result = -1
    Else
        $isWindowHang = _WinAPI_IsHungAppWindow ($hWnd)
        if $isWindowHang then
             $result = 0
        Else
            $result = 1
       EndIf
    EndIf
    ConsoleWrite($result)
    UserParameter setting in zabbix agent config file
    Code:
    UserParameter=computer.windows.appResponse,C:\Zabbix\checkResponse.exe
    Command line response result:
    Click image for larger version

Name:	command.jpg
Views:	256
Size:	21.8 KB
ID:	413711

    Agent response result:

    Click image for larger version

Name:	zabbix_response.jpg
Views:	257
Size:	110.1 KB
ID:	413709

    Attached Files
  • pablitko
    Junior Member
    • Nov 2020
    • 8

    #2
    Originally posted by splitek
    Maybe... agent runs as a service and user work as a user (different context). In services you can try to use "allow service to interact with desktop" and test if it helps.
    Click image for larger version

Name:	service settings.png
Views:	374
Size:	36.4 KB
ID:	413916
    Unfortunately doesn't work. I also tried to run bat file:
    Code:
    powershell.exe C:\Zabbix\checkResponse.exe
    But no effect.

    Comment

    Working...