check_expiry

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_expiry

Postby hardik185 » Wed May 15, 2019 11:49 am

Hi, I am using check_expiry on Linux (RHEL 6) but while running it with check_nrpe, I always get "NRPE: Unable to read output"

I can see nagios is not able to execute this script to check user's password expiry information. any idea on how this can be achieved?
hardik185
 
Posts: 1
Joined: Wed May 15, 2019 11:44 am

Re: check_expiry

Postby cdienger » Wed May 15, 2019 4:47 pm

Edit line 15 to look like:

Code: Select all
        if [[ $get_expiry_date == *"Never"*  ]]


Test again and let us know the results. If it still fails, try running the script directly on the host and not using check_nrpe:

Code: Select all
bash -x ./check_expiry <username>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3003
Joined: Tue Feb 07, 2017 11:26 am

Re: check_expiry

Postby npolovenko » Wed May 15, 2019 5:00 pm

@hardik185, On top of what Craig recommended, I suggest adding the following entries to the /etc/sudoers file on the nrpe server.
Code: Select all
nagios ALL = NOPASSWD:/tmp/check_expiry.sh
nagios ALL = NOPASSWD:/usr/sbin/lchage
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 3312
Joined: Mon May 15, 2017 5:00 pm


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 0 guests