Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback
Plugins4405Themes and Skins13Add-ons759Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Network Connections, Stats and Bandwidth check_interfaces_wmi
2.0 (2)
155.1K
RSS Feed
Newest Listings Updated Listings
Top Contributors
deskwork_itunes142 (4)Chad Columbus (3)Marcin Bednarski (3)Davide Lemma (3)mngvn (2)
See More
Newest Contributors
matthewducey (1)Linuxfabrik (1)signalgrid (1)Sanna Glue (2)fisherrs (1)
See More

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > Erling Ouweneel
EO

Erling Ouweneel

@erling

User Stats

Member Since: June 26, 2015

Favorites0

Views

Projects0

No Projects Found
check_file_exists

Great script, but needed it the other way around

Great script, but I needed a script to check if a file does not exist. On my Ubuntu server I want to check if the file /var/run/reboot-required does not exist and warn me if it does (to notify me the server needs a reboot). To check this I just had to switch the output statements of the script, which I saved as check_file_notexists. Hereby the altered code for check_file_notexists: #! /bin/bash # # Author : Diego Martin Gardella [[email protected]] # Modified by Erling Ouweneel to switch OK and CRITICAL # # Desc : Plugin to verify if a file does not exist # # PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\/][^\/][^\/]*$,,'` . $PROGPATH/utils.sh if [ "$1" = "" ] then echo -e " Use : $PROGNAME -- Ex : $PROGNAME /etc/hosts n " exit $STATE_UNKNOWN fi if [ -f $1 ] then echo "CRITICAL - $1 : EXISTS :: `head -3 $1`" # shows the first three lines of the file exit $STATE_CRITICAL else echo "OK : $1 Does NOT exists " exit $STATE_OK fi

Reviewed 11 years ago

No Favorites Found

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile