Zookeeper script throwing an error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Zookeeper script throwing an error

Post by shamrozkadiwal »

I dont think so this would be an issued but I have commented out it just for safe side.

Code: Select all

/etc/nagios/objects/commands.cfg:   command_name    check_zookeeper
/etc/nagios/objects/commands.cfg:   command_line    $USER1$/check_plugin.pl $USER1$/check_zookeeper.pl -H $HOSTADDRESS$ -P 4150
I have also modified /etc/group as you directed and also attached new info.txt.
Attachments
info.txt
(220.01 KiB) Downloaded 220 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Zookeeper script throwing an error

Post by tgriep »

I think I found what the issue is.
The file was opened with a editor that added carriage returns in the script and that is causing the error.
Install an application on the Nagios server called dos2unix and then run the following to remove them.

Code: Select all

dos2unix /usr/lib/nagios/plugins/check_zookeeper_apache.py
Test the plugin and let us know if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Zookeeper script throwing an error

Post by shamrozkadiwal »

This is a Gentoo server and have some issue with repository. We cant take any risk to install and break the box. Is there any alternate to fix the script?
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Zookeeper script throwing an error

Post by shamrozkadiwal »

I ran this command instead of installing dos2unix.

Code: Select all

# cat check_zookeeper_apache.py | tr -d '\015' > ./check_zookeeper_apache_new.py
Attachments
Looks_good.JPG
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Zookeeper script throwing an error

Post by tgriep »

It looks like removing the characters made the plugin work for you.
Let us know if you have any further questions or that we can lock the post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Zookeeper script throwing an error

Post by shamrozkadiwal »

I really appreciate all the help. Please close the ticket.

Thanks!
Locked