Help needed witch check_file_age

  • I want to monitor the file age of a backup file on a remote client but it seems I just cant see my error


    This is my service definition on the client

    If I run check_file_age on the command line of the client everything is correct

    Code
    1. /usr/lib/nagios/plugins/check_file_age /home/user/backup/databases.tar.gz -w 90000 -c 1800000 -C 22 -W 3322222
    2. FILE_AGE OK: /home/user/databases.tar.gz is 71196 seconds old and 13726588 bytes | age=71196s;90000;1800000 size=13726588B;3322222;22;0

    But Icinga2web on the master tells me

    Code
    1. FILE_AGE CRITICAL: /home/user/databases.tar.gz is 71346 seconds old and 13726588 bytes
  • hm. but the actual size is way bigger then both of the C/W values and the file age is smaller then the then the c/w values.


    So where does the "critical status" come from?

  • For me this doesnt look bad

    Code
    1. * vars
    2. * file_age_C = 22
    3. * file_age_W = 332222
    4. * file_age_c = 270000
    5. * file_age_file = "/home/user/backup/databases.tar.gz"
    6. * file_age_w = 90000
    7. * sla = "24x7"
    8. * volatile = false
    9. * zone = ""

    The post was edited 1 time, last by hbauer ().

  • not sure if I understand. Is there a different way/possibility to call a plugin as the way I already posted in my opening question?


    Code
    1. /usr/lib/nagios/plugins/check_file_age /home/user/backup/databases.tar.gz -w 90000 -c 1800000 -C 22 -W 3322222
    2. FILE_AGE OK: /home/user/databases.tar.gz is 71196 seconds old and 13726588 bytes | age=71196s;90000;1800000 size=13726588B;3322222;22;0
  • ok I may be totally of track but this is the service definition on icinga client


    and this is the result of "icinga2 object list --type service"

    I only change file/service and server names since they contain sensitive names.

  • According to your definition I'd have expected a call like


    /usr/lib/nagios/plugins/check_file_age /home/user/backup/databases.tar.gz -w 90000 -c 270000 -C 22 -W 332222


    which is slightly different from


    /usr/lib/nagios/plugins/check_file_age /home/user/backup/databases.tar.gz -w 90000 -c 1800000 -C 22 -W 3322222


    I agree that neither of the values of the file exceeds any of the thresholds (as far as I can see).


    Are there any messages in icinga.log related to this check?

  • no, I dont see any messages in the log and yes. icinga is allowed to read the file

    Code
    1. ls -ls /home/user/backup/databases.tar.gz -ls
    2. 13424 -rw------- 1 nagios nagios 13723421 Aug 27 13:40 /home/user/backup/databases.tar.gz
    3. ps -ef | grep icinga
    4. nagios 1189 1 0 14:46 ? 00:00:10 /usr/lib/i386-linux-gnu/icinga2/sbin/icinga2 -
  • Hm. I just tested "./check_file_age -f FILENAME -W <size> -C <size>" with different values and I don't see any reliable pattern so far. Specifying values below or above the file size doesn't make no difference. It's "FILE_AGE CRITICAL" all the time :-(.

    Using "./check_file_age -f FILENAME -w <seconds -c <seconds" shown correct results.


    Edit: Calling the plugin without -w ... -c ... puts the defaults (240/600) in place so CRITICAL is correct with an age older than 600 seconds.

  • so where does the master node take this values from? The service definition that was created looks like this and does not contain any values


    Code
    1. more Backup.conf
    2. object Service "DB-Backup" {
    3. import "satellite-service"
    4. check_command = "dummy"
    5. host_name = "backup"
    6. zone = "backup"
    7. }
  • Extract the executed command line from Icinga 2 itself, this should be your first call when plugin parameters don't work as configured.


    https://www.icinga.com/docs/ic…ecuted-command-for-checks


    The simplest one is the REST API these days.