Page 1 of 1

Monitor NAS share availability

Posted: Mon Mar 27, 2017 6:55 am
by jkinning
We experienced an issue where one of our critical systems failed due to an issue caused by our NetApp NAS which was attached to this server being unavailable. I was trying to setup a monitoring task to check that this path is available but I am not having much luck. I placed a file in the directory on the NAS called nagios_check.txt and using this check to monitor this file
check_nrpe -H cinzl01d -t 15 -c check_files -a path='\\cinnas1t\zldev\bloomberg' pattern='nagios_check.txt' max-depth=1 'critical=count<1' 'empty-state=critical'

It works until I have our NAS admin disconnect the share and then the check for this client just says
UNKNOWN HARD 5 of 5 CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

As soon as the client connection is established again Nagios sends out the critical warning but shortly after sends the OK. I am running the NSClient on this server as a service account which has access to this NAS share. Is there another way I can check this so when the volume is gone Nagios can alert the Business Unit? I was thinking when the file was unavailable Nagios would send a critical notification but instead just shows unknown.

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 10:15 am
by avandemore
It sounds like the issue is with NSClient. Did you check the NSClient logs? What do they say?

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 11:42 am
by jkinning
Error says - 2017-03-24 15:19:04: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: \\cinnas1t\zldev\bloomberg

I have attached the nsclient.log file.

It works and is OK now that it can see the file in the \\cinnas1t\zldev\bloomberg directory but once we disconnect the NAS I am not getting any critical notifications.

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 12:18 pm
by scottwilkerson
This appears to be a known NSClient++ issue, although I can't confirm it is fixed in any current versions

https://github.com/mickem/nscp/issues/172

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 12:20 pm
by WillemDH
Are you sure the system nscp is running on has permissions on this share?

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 12:49 pm
by scottwilkerson
WillemDH wrote:Are you sure the system nscp is running on has permissions on this share?
Willem,

The OP's problem goes away when the client re-establishes connection.

The more I think about it, UNKNOWN may almost be the proper message. You are asking to count the files, if you can't even make the connection, you actually don't know if a critical state has been reached...

I would still look into an updated NSCP version that may have the fix.

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 2:46 pm
by jkinning
I will try to update the NSClient++ and that is what I was thinking. It didn't know how to report back so it was just "unknown".

I am running the nsclient service as a user who has access to the share. It works as long as the share is available. Once the share goes away I would think a critical notification would be dispatched but it goes into an unknown state.

Re: Monitor NAS share availability

Posted: Mon Mar 27, 2017 3:02 pm
by scottwilkerson
Until you get the desired effect from NSClient++ you can create a custom check command using the negate plugin to change the UNKNOWN to CRITICAL for this check

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Monitor NAS share availability

Posted: Thu Mar 30, 2017 9:48 am
by jkinning
I'll give the negate plugin a go for this service check so when unknown comes up it will trigger a notification.

Re: Monitor NAS share availability

Posted: Thu Mar 30, 2017 12:51 pm
by scottwilkerson
Sounds good, let us know if we can be of assistance