Let check_drupal_log read from stdin
I found myself in an awkward situation where I couldn't run NRPE or use check_by_ssh on the system hosting a Drupal instance I needed to monitor, hence this patch which allows check_drupal_log to read from stdin.
The expected use of this feature is that on the web server, a cron job will run check_drupal_log -l /var/www/foo/cdl.txt to dump plugin output to a text file. On the monitoring server, Nagios (or Icinga or...) picks up the content of the file and parses it by running curl https://my.site.example.com/foo/cdl.txt | check_drupal_log -f -
@waoki this is a nice feature.
Is - a standard way to make sure input is coming from stdin?
Also what would happen (in the rare case) if there is a file called -?
Could you also please add this information to print_usage and print_help.
'-' is probably the second-most common way to read from stdin (the most common being to assume stdin if no input file is specified). In this case, it makes it impossible to have check_drupal_log read from a file called '-'; some programs use fancy syntax to let you read a file called '-', but my experience is that most which support this syntax just can't read from such a file.
I've updated print_usage and print_help to mention this feature.