Check File SQL error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Check File SQL error

Post by wspackaging »

recently upgraded to 5.5.2 and I started getting this error doing a file count.

2018-07-26 15:23:19: debug:CACHENSClient++.cpp:557: Attempting to start NSCLient++ - 0.3.9.328 2011-08-16
2018-07-26 15:23:19: message:CACHEmodules\FileLogger\FileLogger.cpp:87: Log path is: C:\Program Files\NSClient++\\nsclient.log
2018-07-26 15:23:19: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 15:26:01: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 15:38:18: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 15:41:00: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 15:53:16: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 15:55:57: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 16:08:15: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 16:10:56: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 16:23:13: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.
2018-07-26 16:25:54: error:modules\NRPEListener\NRPEListener.cpp:317: Exception handling NRPE packet: Invalid packet version.

When I try to do "Run Check Command" from CCM I get:
SQL Error [nagiosxi] : ERROR: syntax error at or near "D"
LINE 1: ...pe -H 10.100.32.120 -t 30 -c CheckFiles -a path=\'D:\\\\Dell...
^

[nagios@dc1ux086 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.100.32.120 -t 30 -c CheckFiles -a path='D:\\Dell\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=2000 MaxCrit=5000 'filter=size gt 0b'
Error submitting command.

Any suggestions?
-pete
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check File SQL error

Post by lmiltchev »

Does adding the "-2" flag to your command help?

Example:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H 10.100.32.120 -t 30 -c CheckFiles -a path='D:\\Dell\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=2000 MaxCrit=5000 'filter=size gt 0b'
For more info on the issue, see our NRPE - Packet Size Explained KB article here:

https://support.nagios.com/kb/article/n ... d-518.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Re: Check File SQL error

Post by wspackaging »

running the suggested command from the CLI with the -2 I get this error.

[root@dc1ux086 ~]# /usr/local/nagios/libexec/check_nrpe -2 -H 10.100.32.120 -t 30 -c CheckFiles -a path='D:\\Dell\\ArchiveManager\\Error' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=2000 MaxCrit=5000 'filter=size gt 0b'
Could not construct return packet in NRPE handler check client side (nsclient.log) logs...


-pete
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check File SQL error

Post by lmiltchev »

Can you post the nsclient.log and nsclient.ini files on the forum? Please remove/obfuscate sensitive data.
Be sure to check out our Knowledgebase for helpful articles and solutions!
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Re: Check File SQL error

Post by wspackaging »

there is no nsclient.ini file. I'm assuming it is the NSC.ini file.
I attached both files
-pete
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check File SQL error

Post by lmiltchev »

You version of NSClient++ agent is very old. I don't think you can use it with NRPE v.3. I would recommend upgrading your NSClient++ agent to the latest stable version. Make a backup of the NSC.ini file prior to the upgrade in case you have some custom commands.

FYI, I don't even know how this check used to work on the first place. You are not allowing the use of arguments with NRPE...

Code: Select all

;allow_arguments=0
;allow_nasty_meta_chars=0
I can see the following entry in the nsclient.log:
2018-07-31 15:39:52: error:modules\NRPEListener\NRPEListener.cpp:422: Request contained arguments (not currently allowed, check the allow_arguments option).
Also, you have the use+ssl line commented out:

Code: Select all

;use_ssl=1
which may be OK if ssl is enabled by default - I don't remember if it is in ver. 0.3.9.

Once you install the new version of NSClient++, use the following document to enable the NRPE Listener:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Restart the NSClient++ service and test your check again.

On my test machine, I have the following entries under the [/settings/NRPE/server] section:

Code: Select all

insecure = true
use ssl = 1
allow nasty characters = 1
allow arguments = 1
port = 5666
extended response = 0
allowed ciphers = ALL:!MD5:@STRENGTH
verify mode = none
which works fine for me.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: Check File SQL error

Post by rexconsulting »

Note that there are a lot of syntax differences between NSClient++ 0.3.x and 0.4.x and greater, so do run this through your testing environment first!
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check File SQL error

Post by lmiltchev »

@rexconsulting, good call! Yes, there are many differences. Even the name of the config file is different - NCS.ini vs nsclient.ini. :)

Upgrading the agent is a "must" though. 0.3.9 is really too old and buggy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
wspackaging
Posts: 43
Joined: Mon Jul 15, 2013 10:36 am

Re: Check File SQL error

Post by wspackaging »

upgraded the client. Ran through the supplied documentations.

when I run a check as root from the Nagios server to the windows clients I get:
root@dc1ux086 libexec]# ./check_nrpe -H dc1ms032120
CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 10.100.32.120: 1


I attached the new nsclient++.ini file and the new log

Thanks for your help on this
-pete
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check File SQL error

Post by lmiltchev »

Try the following:

1. Commend out these two lines in nsclient.ini file:

Code: Select all

; ssl options = no-sslv2,no-sslv3
; verify mode = peer-cert
2. Add the following line under the [/settings/NRPE/server] section:

Code: Select all

allowed ciphers = ALL:!MD5:@STRENGTH
3. Save, exit, and restart the nsclient++ service.

Did this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked