nagios-plugins-file_age-2.1.4-2.el6.x86_64 can't find any fi

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
NzBQG
Posts: 1
Joined: Wed Jan 11, 2017 8:49 am

nagios-plugins-file_age-2.1.4-2.el6.x86_64 can't find any fi

Post by NzBQG »

2.1.4 from EPEL seems to have broken the check_file_age plugin. What can I do?

Code: Select all

[box ~]$ sudo touch this /this
[box ~]$ /usr/lib64/nagios/plugins/check_file_age -f this
FILE_AGE CRITICAL: File not found - "this"
[box ~]$ /usr/lib64/nagios/plugins/check_file_age -f /root/
FILE_AGE CRITICAL: File not found - "/root/"
[box ~]$ /usr/lib64/nagios/plugins/check_file_age -f /this
FILE_AGE CRITICAL: File not found - "/this"

Code: Select all

[box ~]$ strace /usr/lib64/nagios/plugins/check_file_age -f /this
execve("/usr/lib64/nagios/plugins/check_file_age", ["/usr/lib64/nagios/plugins/check_"..., "-f", "/this"], [/* 33 vars */]) = 0
brk(0)                                  = 0xf02000
[...cut...]
read(3, "", 4096)                       = 0
close(3)                                = 0
lstat("\"/this\"", 0x7ffce9439ae0)      = -1 ENOENT (No such file or directory)
stat("\"/this\"", 0xf02130)             = -1 ENOENT (No such file or directory)
write(1, "FILE_AGE CRITICAL: File not foun"..., 44FILE_AGE CRITICAL: File not found - "/this"
) = 44
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: nagios-plugins-file_age-2.1.4-2.el6.x86_64 can't find an

Post by tmcdonald »

Yea, my strace gives the following for an older version:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_file_age --version
check_file_age v2.0.3 (nagios-plugins 2.0.3)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
[root@localhost ~]# /usr/local/nagios/libexec/check_file_age -f /this
FILE_AGE OK: /this is 31 seconds old and 0 bytes
[root@localhost ~]# strace -s 256 /usr/local/nagios/libexec/check_file_age -f /this
[ - SNIP - ]
stat("/this", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/this", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(1, "FILE_AGE OK: /this is 46 seconds old and 0 bytes\n", 49FILE_AGE OK: /this is 46 seconds old and 0 bytes
) = 49
Almost looks like the plugin is doing some escaping of the filename for some reason. Let me peek at the code and get back to you.
Former Nagios employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: nagios-plugins-file_age-2.1.4-2.el6.x86_64 can't find an

Post by tmcdonald »

Looks like this was fixed today, actually:

https://github.com/nagios-plugins/nagio ... s/pull/222
Former Nagios employee
Locked