Page 2 of 2

Re: Zookeeper script throwing an error

Posted: Wed May 08, 2019 12:50 pm
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.

Re: Zookeeper script throwing an error

Posted: Wed May 08, 2019 1:15 pm
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.

Re: Zookeeper script throwing an error

Posted: Fri May 10, 2019 11:11 am
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?

Re: Zookeeper script throwing an error

Posted: Fri May 10, 2019 11:50 am
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

Re: Zookeeper script throwing an error

Posted: Fri May 10, 2019 1:04 pm
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.

Re: Zookeeper script throwing an error

Posted: Mon May 13, 2019 12:20 pm
by shamrozkadiwal
I really appreciate all the help. Please close the ticket.

Thanks!