check_application
./check_application.pl [OPTIONS] [-f configuration_file] <job_file> <condition>
-
-h or --help: prints short usage tips
-
-V or --version: prints plugin versions
-
-v X or --verbose X: sets verbosity level to X (see UMI docs)
-
-t Y or --timeout Y: sets plugin execution timeout to Y seconds
This Nagios plugin tests any application accessible via UNICORE by executing job and checking given condition on output files. Requires Perl in version 5.10.0 or further and UCC in version 1.4.0 or further.
Condition format is well-known, similar to boolean expressions in C language. You can use and and or operators, files (local files and files that are output from job - add # before filename) and functions:
-
equals(file1,file2) - returns true if both files exist and are equal,
-
not_empty(file1) - returns true if file1 exists ans is not empty,
-
valid_pdf(file1) - returns true if file1 exists and is valid pdf file,
-
not_fully_equals(file1,file2,diff) - returns true if file1 differs from file2 at maximum diff lines (diff is an integer number),
-
grep(string,file1) - returns true if a string exists in file1,
-
contains(fragment, output_file) - checks if output_file contatins fragment.
-
UCC_PATH: absolute path to UNICORE Commandline Client binary (in version 1.4.0 or higher)
-
UCC_CONFIG: absolute path to valid configuration file for UCC (remember to set absolute paths to keystore and trustore in this file!
-
REGISTRY_URL: address of the Registry
-
SITE_NAME: name of site to run jobs on
-
LOGS_DIR: directory where script should store UCC logs and temporary files
-
UNKNOWN: Wrong condition syntax! See README file: Check testing condition, there is probably some error. After this line there will be full explanation.
-
WARNING: Unable to pass application condition string: A given condition is not fullfilled. Warnings after this line will help to find the problem. Job object will be deleted but all generated files will not be touched and can be revised to find the problem.
-
CRITICAL: Application is not present in IDB: Job cannot be run because of the unavailability of required application (or missing entry in IDB)
-
CRITICAL: TSS is not available: Unable to run job because of some intrnal TSS problem or lack of requested resources (CPUs, memory, etc). Detailed output from UCC will be shown.
-
CRITICAL: Error waiting for job to finish: Job was started but cannot be finished on a target system. Check logs at server side.
-
CRITICAL: Some output files are missing: Some output files that were marked to be produced by application test were not generated. Probably job failed in an early stage, check the stdout and stderr files.
-
CRITICAL: Cannot submit job: Unable to submit job - unknown error. See logs to determine the reason.
-
OK: Test job succeded, time elapsed: XXX: Everything is OK.
./check_application.pl /etc/nagios/PL-Grid/R/r.u "equals(#stdout,/etc/nagios/PL-Grid/R/r_output.stdout) and not_empty(#Rplots.pdf) and valid_pdf(#Rplots.pdf)"
Checks, if stdout from job is equal to /etc/nagios/PL-Grid/R/r_output.stdout and if file Rplots.pdf from job output is not an empty valid pdf file.