Page 1 of 1

Bash script to plugin

Posted: Fri Sep 27, 2024 10:11 am
by kbauma01
Hey everyone,

I have a very basic bash script that checks if a file exists. When I run it on the command line, it works with no issues.

# ./check_file_exist.sh /junk
CRITICAL - /junk does not exist!

# ./check_file_exist.sh /var/log/messages
OK - /var/log/messages exists.

My question is how do I get that check working in XI? There are some servers that have to see that file and if it doesn't exist then alert us. I think there is documentation but my google-fu is not working well this morning!

Re: Bash script to plugin

Posted: Fri Sep 27, 2024 11:59 am
by snapier3
You're almost there!

Read through the plugin development guidelines and I think you'll find what you're looking for...
https://nagios-plugins.org/doc/guidelines.html

Happy Monitoring,
--SN