How to config plugin check_newest_file_age
Re: How to config plugin check_newest_file_age
Hi Scott,
meanwhile in the bat cave... , working on another plugin..... check_dirsize.
Works fine on the commandline, but not trough nrpe ...
Commandline on the remote server:
./check_dirsize -d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f
1698 MB - ok|'size'=1698MB;2000;2048
On the nagios-server commandline:
./check_nrpe -H linux-host -c check_dirsize -a '-d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f'
Error: invalid option -- 'w' /usr/bin/du
nrpe.cfg:
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize -d '$ARG1$' -w '$ARG2$' -c '$ARG3$' -f
Tried several options in the nrpe.cfg, but did not get it to work....
meanwhile in the bat cave... , working on another plugin..... check_dirsize.
Works fine on the commandline, but not trough nrpe ...
Commandline on the remote server:
./check_dirsize -d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f
1698 MB - ok|'size'=1698MB;2000;2048
On the nagios-server commandline:
./check_nrpe -H linux-host -c check_dirsize -a '-d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f'
Error: invalid option -- 'w' /usr/bin/du
nrpe.cfg:
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize -d '$ARG1$' -w '$ARG2$' -c '$ARG3$' -f
Tried several options in the nrpe.cfg, but did not get it to work....
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to config plugin check_newest_file_age
change this
to this
Code: Select all
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize -d '$ARG1$' -w '$ARG2$' -c '$ARG3$' -f
Code: Select all
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize $ARG1$
Re: How to config plugin check_newest_file_age
Hi Scott,scottwilkerson wrote:Hmm, it may have to be set on the first time it is loaded.welbp00 wrote:Yes, i did.
I can only suggest not sending a passive result setting the status to OK
in the nagios web interface, you can force execute the check. After done that, the state Pending was not showing anymore.
Re: How to config plugin check_newest_file_age
Hi Scott,scottwilkerson wrote:change thisto thisCode: Select all
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize -d '$ARG1$' -w '$ARG2$' -c '$ARG3$' -f
Code: Select all
command[check_dirsize]=/usr/lib64/nagios/plugins/check_dirsize $ARG1$
i made the adjustment. I am getting an other message now:
-bash-4.2# ./check_nrpe -H linux-server sudo su - -c check_dirsize -a '-d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f'
Error: Permission denied
The check trough the commandline on the linux-server works fine..
-bash-4.2# ./check_dirsize -d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f
1698 MB - ok|'size'=1698MB;2000;2048
Do i have to do something with sudo...?
Regards, Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to config plugin check_newest_file_age
Can you show the permissions of these
Code: Select all
ls -l /usr/lib64/nagios/plugins/check_dirsize
ls -ld /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
Re: How to config plugin check_newest_file_age
-bash-4.2# ls -l /usr/lib64/nagios/plugins/check_dirsizescottwilkerson wrote:Can you show the permissions of theseCode: Select all
ls -l /usr/lib64/nagios/plugins/check_dirsize ls -ld /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
-rwxr-xr-x 1 root root 4338 May 9 10:55 /usr/lib64/nagios/plugins/check_dirsize
-bash-4.2# ls -ld /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
drwxr-x--- 2 wasadmin wasadmin 16384 May 9 10:14 /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to config plugin check_newest_file_age
In order to allow the nagios user to read from that directory you either need to make it readable to others
or add nagios to the wasadmin group
Code: Select all
chmod o+r /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
Re: How to config plugin check_newest_file_age
I have done chmod o+r, the error message changed to Error: permission denied /usr/bin/duscottwilkerson wrote:In order to allow the nagios user to read from that directory you either need to make it readable to othersor add nagios to the wasadmin groupCode: Select all
chmod o+r /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
Re: How to config plugin check_newest_file_age
I have got it to work; added this to /etc/sudoers.d/ 040_nrpe_dmgrwelbp00 wrote:I have done chmod o+r, the error message changed to Error: permission denied /usr/bin/duscottwilkerson wrote:In order to allow the nagios user to read from that directory you either need to make it readable to othersor add nagios to the wasadmin groupCode: Select all
chmod o+r /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES
nrpe ALL = (wasadmin) NOPASSWD: /usr/bin/du
nrpe ALL = (wasadmin) NOPASSWD: /usr/lib64/nagios/plugins/check_dirsize -d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-
6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f
nrpe.cfg:
command[check_dirsize]=sudo -u wasadmin /usr/lib64/nagios/plugins/check_dirsize $ARG1$
Is this the correct way to do it?
Regards,
Paul.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to config plugin check_newest_file_age
sure, that would work too.welbp00 wrote: Is this the correct way to do it?
Glad to hear you got it working