Still got a problem....
On the commandline the command works fine, but if i execute the command from the Nagios gui, i see this error in the secure.log:
May 15 15:26:43 on7p0041 sudo: pam_unix(sudo:auth): conversation failed
May 15 15:26:43 on7p0041 sudo: pam_unix(sudo:auth): auth could not identify password for [nrpe]
May 15 15:26:43 on7p0041 sudo: pam_sss(sudo:auth): authentication failure; logname= uid=995 euid=0 tty= ruser=nrpe rhost= user=nrpe
May 15 15:26:43 on7p0041 sudo: pam_sss(sudo:auth): received for user nrpe: 10 (User not known to the underlying authentication module)
May 15 15:26:43 on7p0041 sudo: nrpe : command not allowed ; TTY=unknown ; PWD=/ ; USER=wasadmin ; COMMAND=/usr/lib64/nagios/plugins/check_dirsize
This is in the sudoers-file:
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
From the cli i can put in sudo -u wasadmin or witht the user nagios or nrpe, command works fine....
Any idea? Thnx
How to config plugin check_newest_file_age
-
- 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
Your command might need to be just
Code: Select all
command[check_dirsize]=sudo /usr/lib64/nagios/plugins/check_dirsize $ARG1$
Re: How to config plugin check_newest_file_age
Changed a few things, now ik works:
nrpe.cfg:
command[check_dirsize]=sudo -u wasadmin /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
/etc/sudoers:
nrpe ALL=(ALL) NOPASSWD: ALL
Not really what i wanted.... the directory is different in the dev environment then in the production environment....
Should be an variable...
How to fix that?
nrpe.cfg:
command[check_dirsize]=sudo -u wasadmin /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
/etc/sudoers:
nrpe ALL=(ALL) NOPASSWD: ALL
Not really what i wanted.... the directory is different in the dev environment then in the production environment....
Should be an variable...
How to fix that?
-
- 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
If your command is set as thiswelbp00 wrote:Not really what i wanted.... the directory is different in the dev environment then in the production environment....
Should be an variable...
How to fix that?
Code: Select all
command[check_dirsize]=sudo -u wasadmin /usr/lib64/nagios/plugins/check_dirsize $ARG1$
Code: Select all
./check_nrpe -H linux-server -c check_dirsize -a '-d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f'
Re: How to config plugin check_newest_file_age
Yes, got it to work.... however... just once.. Then i see in the nagios gui this error:scottwilkerson wrote:If your command is set as thiswelbp00 wrote:Not really what i wanted.... the directory is different in the dev environment then in the production environment....
Should be an variable...
How to fix that?You can pass it in an argument such asCode: Select all
command[check_dirsize]=sudo -u wasadmin /usr/lib64/nagios/plugins/check_dirsize $ARG1$
Code: Select all
./check_nrpe -H linux-server -c check_dirsize -a '-d /ConnectionsContentStoreLink/blogs/upload/f/b/c/fbc40af7-f364-4114-bd59-6cdddd04f6d0/BLOGS_UPLOADED_IMAGES -w 2000 -c 2048 -f'
Critical: Service check timed out after 60.01 seconds
I have tried several time out values, but nothing worked....
-
- 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
That's a really long time for a check to process, how long does it take when you run it on the remote system?
I worry that you are going to cause serious performance issues on the remote system/drive if it takes that long to process and runs very frequently.
That said, to get it to work you likely will need to increase the service_check_timeout directive in your nagios.cfg to a timeframe over 60s
then restart nagios.
I worry that you are going to cause serious performance issues on the remote system/drive if it takes that long to process and runs very frequently.
That said, to get it to work you likely will need to increase the service_check_timeout directive in your nagios.cfg to a timeframe over 60s
then restart nagios.
Re: How to config plugin check_newest_file_age
Tested with several timeout settings... NOK.scottwilkerson wrote:That's a really long time for a check to process, how long does it take when you run it on the remote system?
I worry that you are going to cause serious performance issues on the remote system/drive if it takes that long to process and runs very frequently.
That said, to get it to work you likely will need to increase the service_check_timeout directive in your nagios.cfg to a timeframe over 60s
then restart nagios.
Put this back into the nrpe.cfg :
command[check_dirsize]=sudo -u wasadmin /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
set the timeout back to 60 seconds as well, and it still works...
Set the timeperiod to run once a day. Sofar looks okay.
I think i leave it this way, and make a separate nrpe.cfg for the production environment. The path to the dir is different there.
Thnx sofar Scott.
-
- 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
sounds good!welbp00 wrote:Tested with several timeout settings... NOK.scottwilkerson wrote:That's a really long time for a check to process, how long does it take when you run it on the remote system?
I worry that you are going to cause serious performance issues on the remote system/drive if it takes that long to process and runs very frequently.
That said, to get it to work you likely will need to increase the service_check_timeout directive in your nagios.cfg to a timeframe over 60s
then restart nagios.
Put this back into the nrpe.cfg :
command[check_dirsize]=sudo -u wasadmin /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
set the timeout back to 60 seconds as well, and it still works...
Set the timeperiod to run once a day. Sofar looks okay.
I think i leave it this way, and make a separate nrpe.cfg for the production environment. The path to the dir is different there.
Thnx sofar Scott.