TFTP

check_tftp.sh

Description:

The plugin check_tftp monitors availability of a TFTP Server, which is normaly used for booting clients over the network.

Current Version

Last Release Date

June 22, 2009

Compatible With


Project Files
Project Notes
It downloads a test file from the TFTP server and checks its size against a given value.
Reviews (4) Add a Review
Change some lines to work in newer OS/TFTP versions
by tachtler, February 29, 2016

Good but in newer versions you have to change following lines: ORIG: RESULT="$(echo get NaGiOs_ChEcK_FiLe | tftp $HOST 2>&1 | head -n 1)" TO RESULT="$(echo get NaGiOs_ChEcK_FiLe | tftp -v $HOST 2>&1 | grep Received)" ORIG: RESULT="$(echo get $FILENAME | tftp $HOST 2>&1 | head -n 1)" TO: RESULT="$(echo get $FILENAME | tftp $HOST 2>&1 | grep Received)" ORIG: *"Received "*" bytes in "*" seconds") TO: *"Received "*" bytes in "*" seconds"*) Than it will work fine again! Klaus Tachtler.



Small Bug 1.0.2
by lgroschen, February 28, 2015

Works well. I found a version 1.0.2 and there was a small bug on line 422: RESULT=$(echo "$RESULT" | head -1 ) which grabbed the wrong string to fine the "file not found" message. Every time you ran the --connect it would return CRITICAL RESULT=$(echo "$RESULT" | head -2 | tail -1 ) -will work there and return OK (I will look into getting v1.0.2 on the exchange with the above patch if it is updated)



works after some work
by hk@, May 31, 2013

besides the typo in line 411. we had to copy the "create tempdir" part to the "connect only check" as otherwise tftp always fails for "permission denied" - resulting in this update: function check_connect () { HOST="$1" # tmp-dir creation is necessary also for connect-only-check # as the tftp get fails otherwise with "permission denied" # 20130509 hk@kapper.net TMPDIR=/tmp/check_tftp mkdir -p "$TMPDIR" cd "$TMPDIR" || { echo "Cannot create temporary directory in /tmp" exit $STATE_UNKNOWN } RESULT="$(echo get NaGiOs_ChEcK_FiLe | tftp $HOST 2>&1 | head -n 1)" rm -f NaGiOs_ChEcK_FiLe # call fixed - was: check_prinzipal_errors "$RESULT" check_principal_errors "$RESULT" case "$RESULT" in *"Error code 1: File not found") echo "TFTP OK - answer from server" exit $STATE_OK ;; *) echo "$RESULT" exit $STATE_CRITICAL ;; esac }



Very Good Check
by derekbrewer, May 31, 2013

One minor typo I found was on line 411. check_prinzipal_errors should be check_principal_errors. Otherwise, works very well.



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.2 (5)
Favorites
1
Views
97,615