Problem with folder_watch.pl
Problem with folder_watch.pl
Hi All
We are running Nagios XI 5.2.3 on CentOS release 6.7 (Final)
I'm trying to use "folder_watch.pl" configure over the wizard.
But even on the cl it is not working as you can see below.
I am checking the folder /tmp/nagiosxitest on a remote server over ssh, if the file 'murat.log' is present.
Nagios lists the file, but gives as output "OK - 0 murat.log files found | 'murat.log'=0".
My goal is to trigger an alarm if the file "murat.log" is found in the folder "/tmp/nagiosxitest."
Please help.
****************************************************************************************
[nagios@cnaxi212 ~]$ /usr/local/nagios/libexec/folder_watch.pl -C 'ssh [email protected] ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -f -v
Translated filespec 'murat.log' to regex 'murat\.log'
folder_watch.pl plugin version 0.43_nagios
Alarm at 30
Command Specified: ssh [email protected] ls -l /tmp/nagiosxitest
Executing ssh [email protected] ls -l /tmp/nagiosxitest 2>&1
got line: total 4
processed: type=unset
parsed: type=unset type=unset
got line: -rw-r--r-- 1 nagios nagios 84 2016-04-06 09:57 murat.log
processed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
parsed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
Date 1459936924 Oldest_filetime: undef Newest_filetime: undef
Largest file has size of octet and smallest octet
OK - 0 murat.log files found | 'murat.log'=0
[nagios@cnaxi212 ~]$
We are running Nagios XI 5.2.3 on CentOS release 6.7 (Final)
I'm trying to use "folder_watch.pl" configure over the wizard.
But even on the cl it is not working as you can see below.
I am checking the folder /tmp/nagiosxitest on a remote server over ssh, if the file 'murat.log' is present.
Nagios lists the file, but gives as output "OK - 0 murat.log files found | 'murat.log'=0".
My goal is to trigger an alarm if the file "murat.log" is found in the folder "/tmp/nagiosxitest."
Please help.
****************************************************************************************
[nagios@cnaxi212 ~]$ /usr/local/nagios/libexec/folder_watch.pl -C 'ssh [email protected] ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -f -v
Translated filespec 'murat.log' to regex 'murat\.log'
folder_watch.pl plugin version 0.43_nagios
Alarm at 30
Command Specified: ssh [email protected] ls -l /tmp/nagiosxitest
Executing ssh [email protected] ls -l /tmp/nagiosxitest 2>&1
got line: total 4
processed: type=unset
parsed: type=unset type=unset
got line: -rw-r--r-- 1 nagios nagios 84 2016-04-06 09:57 murat.log
processed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
parsed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
Date 1459936924 Oldest_filetime: undef Newest_filetime: undef
Largest file has size of octet and smallest octet
OK - 0 murat.log files found | 'murat.log'=0
[nagios@cnaxi212 ~]$
Re: Problem with folder_watch.pl
You can try using the negate plugin changing the "OK" status to "CRITICAL". For more information on the negate plugin, see the document below:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Problem with folder_watch.pl
Is the problem not that the plugin does not find the file?
The output show "OK - 0 murat.log files found | 'murat.log'=0".
But as you can see on the"ls -l", there is a file named "murat.log"
The output show "OK - 0 murat.log files found | 'murat.log'=0".
But as you can see on the"ls -l", there is a file named "murat.log"
Re: Problem with folder_watch.pl
Run the following commands and show us the output:
On the remote box:
On the Nagios XI server:
On the remote box:
Code: Select all
uname -a
cat /etc/*release
ls -ld /tmp/nagiosxitestCode: Select all
grep nag /etc/group
ls -l /usr/local/nagios/libexec/folder_watch.plBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Problem with folder_watch.pl
On the remote box:
csvdb008:/tmp/nagiosxitest # uname -a
Linux csvdb008 2.6.34.10-0.6-default #1 SMP 2011-12-13 18:27:38 +0100 x86_64 x86_64 x86_64 GNU/Linux
csvdb008:/tmp/nagiosxitest # cat /etc/*release
openSUSE 11.3 (x86_64)
VERSION = 11.3
csvdb008:/tmp/nagiosxitest # ls -ld /tmp/nagiosxitest
drwxr-xr-x 2 root root 60 Apr 6 09:59 /tmp/nagiosxitest
csvdb008:/tmp/nagiosxitest #
On the Nagios XI server:
[root@cnaxi212 ~]# grep nag /etc/group
nagios
500:nagios,apache
nagcmd
501:nagios,apache
[root@cnaxi212 ~]# ls -l /usr/local/nagios/libexec/folder_watch.pl
-rwxr-xr-x 1 root nagios 40695 Dec 8 17:29 /usr/local/nagios/libexec/folder_watch.pl
[root@cnaxi212 ~]#
csvdb008:/tmp/nagiosxitest # uname -a
Linux csvdb008 2.6.34.10-0.6-default #1 SMP 2011-12-13 18:27:38 +0100 x86_64 x86_64 x86_64 GNU/Linux
csvdb008:/tmp/nagiosxitest # cat /etc/*release
openSUSE 11.3 (x86_64)
VERSION = 11.3
csvdb008:/tmp/nagiosxitest # ls -ld /tmp/nagiosxitest
drwxr-xr-x 2 root root 60 Apr 6 09:59 /tmp/nagiosxitest
csvdb008:/tmp/nagiosxitest #
On the Nagios XI server:
[root@cnaxi212 ~]# grep nag /etc/group
nagios
nagcmd
[root@cnaxi212 ~]# ls -l /usr/local/nagios/libexec/folder_watch.pl
-rwxr-xr-x 1 root nagios 40695 Dec 8 17:29 /usr/local/nagios/libexec/folder_watch.pl
[root@cnaxi212 ~]#
Re: Problem with folder_watch.pl
Try adding a warning threshold like below to your command.
This will make the check return OK if the file doesn't exist and critical if it does.
Code: Select all
-w @1:1Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Problem with folder_watch.pl
It's still not working:
[nagios@cnaxi212 ~]$ /usr/local/nagios/libexec/folder_watch.pl -C 'ssh [email protected] ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -w '@1:1'
OK - 0 murat.log files found
The file is there!
remoteserver:/tmp/nagiosxitest # ls -l
total 4
-rw-r--r-- 1 nagios nagios 84 Apr 6 09:57 murat.log
[nagios@cnaxi212 ~]$ /usr/local/nagios/libexec/folder_watch.pl -C 'ssh [email protected] ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -w '@1:1'
OK - 0 murat.log files found
The file is there!
remoteserver:/tmp/nagiosxitest # ls -l
total 4
-rw-r--r-- 1 nagios nagios 84 Apr 6 09:57 murat.log
Re: Problem with folder_watch.pl
Run the command adding verbose output "-v" and post the output.
Code: Select all
/usr/local/nagios/libexec/folder_watch.pl -C 'ssh [email protected] ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -w '@1:1' -vBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Problem with folder_watch.pl
[nagios@cnaxi212 ~]$ /usr/local/nagios/libexec/folder_watch.pl -C 'ssh nagios@csvdb008 ls -l /tmp/nagiosxitest' -F 'murat.log' -T 'files' -w '@1:1' -v
Translated filespec 'murat.log' to regex 'murat\.log'
Only warning value check is specified - setting critical to ~
folder_watch.pl plugin version 0.43_nagios
Alarm at 30
Command Specified: ssh nagios@csvdb008 ls -l /tmp/nagiosxitest
Executing ssh nagios@csvdb008 ls -l /tmp/nagiosxitest 2>&1
got line: total 4
processed: type=unset
parsed: type=unset type=unset
got line: -rw-r--r-- 1 nagios nagios 84 2016-04-06 09:57 murat.log
processed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
parsed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
Date 1460547117 Oldest_filetime: undef Newest_filetime: undef
Largest file has size of octet and smallest octet
OK - 0 murat.log files found
[nagios@cnaxi212 ~]$
Translated filespec 'murat.log' to regex 'murat\.log'
Only warning value check is specified - setting critical to ~
folder_watch.pl plugin version 0.43_nagios
Alarm at 30
Command Specified: ssh nagios@csvdb008 ls -l /tmp/nagiosxitest
Executing ssh nagios@csvdb008 ls -l /tmp/nagiosxitest 2>&1
got line: total 4
processed: type=unset
parsed: type=unset type=unset
got line: -rw-r--r-- 1 nagios nagios 84 2016-04-06 09:57 murat.log
processed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
parsed: time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file time= mode=644 size=84 time_line=2016-04-06 09:57 murat.log nfiles=1 group=nagios user=nagios type=file
Date 1460547117 Oldest_filetime: undef Newest_filetime: undef
Largest file has size of octet and smallest octet
OK - 0 murat.log files found
[nagios@cnaxi212 ~]$
Re: Problem with folder_watch.pl
Can you zip up the "/usr/local/nagios/libexec/folder_watch.pl" file, and upload it to the forum? I would like to compare it to the one we are using in house.
Be sure to check out our Knowledgebase for helpful articles and solutions!