Created
January 7, 2021 21:08
-
-
Save alchemyx/2315333244e33c0f691f2422b0ca0482 to your computer and use it in GitHub Desktop.
Simple Nagios check for tftp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # https://github.com/alchemyx | |
| host=127.0.0.1 | |
| # Try to upload myself | |
| cd $(dirname $0) | |
| filename=$(basename $0) | |
| output=$(/usr/bin/tftp $host -c put $filename) | |
| retcode=$? | |
| if [ $retcode -eq 0 ]; then | |
| echo "OK - Uploaded to $host" | |
| exit 0 | |
| else | |
| echo "CRITICAL - Can't upload to $host - $output" | |
| exit 2 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment