Skip to content

dnmvisser/nagios-check-file-exists

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

check-file-exists

A Nagios check to monitor the presence of absence of a file

Requirements

Python3 with the argparse, sys, os, and textwrap modules

Usage

user@host$ ./check-file-exists --help
usage: check-file-exists [-h] -f PATH [--present | --absent]
                         [--warning | --critical]

Check for the (non) existence of a file

optional arguments:
  -h, --help            show this help message and exit
  -f PATH, --file PATH  file to check
  --present             return OK if file exists, and WARNING or CRITICAL if
                        file does not exist
  --absent              return OK if file does not exist, and WARNING or
                        CRITICAL if it exists
  --warning, -w         Upon failure, return WARNING
  --critical, -c        Upon failure, return CRITICAL

To check for pending reboots on Debian/Ubuntu:

check-file-exists -f /var/run/reboot-required --absent

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages