Did you write the script yourself or get it from somewhere else (if so,
where)?
What are the first 5 non-blank lines of the script?
Have you checked that the script is not in MS-Dos format with ^M characters
at the end of each line?
I’m betting that the #!/ line at the start of the script points to a non-
existent interpreter because it ends in ^M and no file exists with that name.
thanks for your Answer.
No, i found the Script by a Google Search.
The name ist check-apc-usv from exchange.icinga.com
But i`ve got Problems with any .php Check.
I’m intrigued that the project was created on 2020-06-26 and the latest
release is 2019-12-17
Anyway, the first line of the script is:
<?php
That means it has to be processed directly by a PHP interpreter; it cannot be
run as a shell script.
Therefore it's not clear to me how this should be used as an Icinga plugin.
I notice that https://exchange.icinga.com/V4n1X/check-apc-usv/comments has
only a single comment / question, which is "Hello, can you explain me how i
can add install this check?" It's a pity the author has not answered.
As a general guide, if a script does not have a first line starting with "#!/"
(common examples are "#!/bin/bash" and "#!/usr/bin/perl") then it cannot be
used directly as an Icinga check plugin, because without that line, Icinga has
no idea how to run the code contained in the script.
My recommendation is to find an alternative USV/UPS check script, or to contact
the author of this one and find out how it was intended to be used with Icinga
or Nagios.
Regards,
Antony.
which is want you can add to your script so the unix shell knows how to execute your script.
don’t forget to set the permission of the script to executable
chmod +x
after that your command can be the path of the script as you are using it now
best regards nicolas
Hello Mueke666,
I want to use that script in my environment also.
But I don’t know how to install it on my icinga2web server. At the moment I only use the preinstalled scripts/checks and .pl-scripts to check health.
Would you like to give me a little onboarding support?