Hello, I am writing a simple plugin that is checking a presence of index.html file on a remote machine.

When I run my script it is perfectly executed and I have a positive response (exit 0), while when I create a command in centreon - it seems that plugin works however it returns a warning message (exit 1).


And the script itself is the following:

answer=$(sshpass -p "password" ssh $1 test -f "/var/www/html/index.html" && echo "File found" || echo "File not found");

case $answer in

"File found")
echo "YES FILE index.html FOUND"
exit 0
"File not found")
echo "THERE IS NO FILE index.html"
exit 1
echo "UNKNOWN"
exit 3
I do not understand what is wrong.