NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
176 stars 95 forks source link

ncpa agent 3 on windows - problem with logs check #1033

Closed shaiuzi closed 3 months ago

shaiuzi commented 7 months ago

hi ,

problem with agent v3 on win11 machine the ckeck is - logs in version 2.4 it worked just fine , and gave me a result like - OK: system has 0 logs, Total Count has 0 logs (Time range - last 1 hour) in version 3 , i get - UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')

in the listener log i see this errors -

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "listener\windowslogs.py", line 102, in run_check File "listener\windowslogs.py", line 75, in walk File "listener\windowslogs.py", line 72, in log_method File "listener\windowslogs.py", line 91, in get_logs Exception: General error occurred while getting log system: ValueError("time data '2023-11-20 11:15:56.497000+00:00' does not match format '%m/%d/%y %H:%M:%S'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "flask\app.py", line 1455, in wsgi_app File "flask\app.py", line 869, in full_dispatch_request File "flask\app.py", line 867, in full_dispatch_request File "flask\app.py", line 852, in dispatch_request File "listener\server.py", line 305, in token_auth_decoration File "listener\server.py", line 1111, in api File "listener\windowslogs.py", line 105, in run_check AttributeError: 'Exception' object has no attribute 'message'

thanks , shai.

ne-jmichaelson commented 7 months ago

@shaiuzi could you provide a little more detail, specifically which logs you're monitoring on the system. I think I've found where the error is occurring but without that piece of information, I can't really reproduce it and tell why it's occurring.

Thanks much!

shaiuzi commented 7 months ago

hi @ne-jmichaelson , i'm using latest nagios core version , and check the system event log for critical event in the past 1 hour this is the full command - {$USER1$/check_ncpa.py -t "$ARG1$" -p 5693 -H $HOSTADDRESS$ -M $ARG2$ $ARG3$} arg 1ans arg2 are the username and password , and arg 3 is the rest: -q name=system,severity=warning,severity=error,severity=critical,logged_after=1h

shaiuzi commented 6 months ago

i got to conclusion that logs check not display correct result trough the active agent. thats what im get in the result - OK: System has 0 logs, Total Count has 0 logs (Time range - last 168 hours) and of course there is alot messages shown if i check trough the api - i also tested with older version of ncpa - 2.4 and 2.41 same issue in those vertsions also. can anyone assist on this?

image