Home » Categories » Multiple Categories

Nagios XI - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"

Problem Description

After uploading a plugin (check_apc_pdu_load.sh for example), the following error is produced:

The following error message is produced:

-bash: ./check_apc_pdu_load.sh: /bin/bash^M: bad interpreter: No such file or directory

This is caused by the file being in a "Windows" format instead of a "Unix" format. It has to do with the line endings / carriage returns.

 

Resolving The Problem

To resolve the problem you will convert the file to a Unix format. Execute the following steps from an SSH session as a user with root privileges.

The first step is to install the required package:

RHEL | CentOS | Oracle Linux

yum install -y dos2unix

 

Debian | Ubuntu

apt-get install -y dos2unix

 

The next step is to convert the file to a Unix format:

dos2unix /usr/local/nagios/libexec/check_apc_pdu_load.sh


This will output:

dos2unix: converting file /usr/local/nagios/libexec/check_apc_pdu_load.sh to UNIX format ...

 

After completing these steps the plugin should execute as intended.

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Schedulded Backups No Longer Working
Viewed 2446 times since Fri, Jun 3, 2016
Nagios Core - How to Think with Nagios to Solve Monitoring Problems - NWC14
Viewed 2199 times since Mon, Feb 8, 2016
Nagios XI - SNMP MIB Upload Problems
Viewed 3188 times since Mon, Apr 10, 2017
Nagios XI - Configuration Applies, No Changes Take Place
Viewed 2203 times since Tue, Jan 27, 2015
NDOUtils - Message Queue Exceeded
Viewed 6223 times since Thu, Jan 21, 2016
Nagios XI - Notification Problems
Viewed 11092 times since Tue, Jan 27, 2015
Nagios XI - MSSQL Wizards - Adaptive Server connection failed
Viewed 3720 times since Thu, Aug 3, 2017
Nagios XI - Missing localhost Alerts
Viewed 2767 times since Sun, Nov 5, 2017
Nagios XI - HTTP 500 Error / PHP Parse error - Unexpected $end
Viewed 2632 times since Mon, Jan 25, 2016
Nagios XI - Login Screen Keeps Redirecting To Itself
Viewed 2715 times since Wed, Jan 27, 2016