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 - WMI Authentication Problems
Viewed 1100 times since Thu, Feb 25, 2016
Nagios XI - Core Configuration Mananger Display Issues
Viewed 438 times since Tue, Jan 26, 2016
Nagios XI - Migrate Performance Data
Viewed 1235 times since Tue, Jan 26, 2016
Nagios XI - MySQL/MariaDB - Max Connections
Viewed 2191 times since Thu, Jun 2, 2016
Nagios XI - Scheduled Reports Not Running
Viewed 558 times since Thu, Aug 10, 2017
Active Directory / LDAP - Troubleshooting Authentication Integration
Viewed 1945 times since Mon, Jun 26, 2017
Nagios XI - Scheduled Downtime Not Working
Viewed 735 times since Mon, Oct 10, 2016
Nagios XI - MSSQL Wizards - Adaptive Server connection failed
Viewed 1264 times since Thu, Aug 3, 2017
Nagios XI - HTTP 500 Error / White Screen After Login
Viewed 570 times since Mon, Feb 29, 2016
Nagios XI - Unable to Delete Host
Viewed 1930 times since Tue, Dec 16, 2014