mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
239 stars 94 forks source link

Failed to parse arguments for command using old split string method: unknown escape sequence. #664

Closed peterge1998 closed 4 years ago

peterge1998 commented 4 years ago

Issue and Steps to Reproduce

All checks, using nsclient, give a timeout response in the webinterface from icinga2: Check: /usr/lib/nagios/plugins/check_nrpe' '-H' '192.168.101.35' '-u' Response: CHECK_NRPE STATE UNKNOWN: Socket timeout after 10 seconds. See the details from the nsclient.log below. I did not change the config in any way, it was working before, and does so on ca 20 other servers. I reinstalled nsclient and copied the config from one of the working servers, but the log gives the same error.

Expected Behavior

Executing all checks

Actual Behavior

Response: CHECK_NRPE STATE UNKNOWN: Socket timeout after 10 seconds.

Details

Additional Details

NSClient++ log:

2020-01-14 08:16:18: info:c:\source\master\modules\checkexternalscripts\alias.hpp:113: Failed to parse arguments for command using old split string method: unknown escape sequence: check_files "path=c:\program files\nsclient++\nsclient.log" "crit=size > 1G" "top-syntax=${list}" "detail-syntax=${filename] ${size}"
2020-01-14 08:23:02: info:c:\source\master\modules\checkexternalscripts\alias.hpp:113: Failed to parse arguments for command using old split string method: unknown escape sequence: check_files "path=c:\program files\nsclient++\nsclient.log" "crit=size > 1G" "top-syntax=${list}" "detail-syntax=${filename] ${size}"
2020-01-14 08:30:10: info:c:\source\master\modules\checkexternalscripts\alias.hpp:113: Failed to parse arguments for command using old split string method: unknown escape sequence: check_files "path=c:\program files\nsclient++\nsclient.log" "crit=size > 1G" "top-syntax=${list}" "detail-syntax=${filename] ${size}"
mickem commented 4 years ago

This looks wrong: detail-syntax=${filename] ${size} SHould be detail-syntax=${filename} ${size} right or better yet detail-syntax=%(filename) %(size)

peterge1998 commented 4 years ago

I was able to troubleshoot this with the nscp test mode. Needed to change "\" to "/" aswell, its working again with this line in nsclient.ini: alias_nsclientlog = check_files "path=C:/Program Files/NSClient++/nsclient.log" "crit=size > 1G" "top-syntax=${list}" "detail-syntax=${filename} ${size}"