Page 3 of 3

Re: SMART

Posted: Wed Aug 14, 2013 6:28 am
by MPIvan
I did but nothing changed ... same error

Re: SMART

Posted: Wed Aug 14, 2013 4:32 pm
by lmiltchev
I assume you have a script named "smarpfa.vbs" in the NSClient++ script's folder. Modify the nsclient.ini file by doing the following:

Under the [/settings/external scripts/wrapped scripts] section (VISUAL BASIC WRAPPING), change this line:

Code: Select all

vbs = cscript.exe //T:60 //NoLogo scripts\\lib\\wrapper.vbs smartpfa.vbs
to this:

Code: Select all

vbs = cscript.exe //T:60 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
Under the [/settings/external scripts/scripts] section, add the following line:

Code: Select all

check_raid=cscript.exe //T:60 //NoLogo scripts\smartpfa.vbs $ARG1$
Restart the nsclient++ service, so that the changes can take effect.

From the nagios server, run from the command line:

Code: Select all

./check_nrpe -H 172.25.1.101 -c check_raid -a <place your arguments here, wrapped in single quotes>
Hope this helps.

Re: SMART

Posted: Fri Aug 16, 2013 1:51 am
by MPIvan
Hi ... now we have some progress but i get some error ... also i don't know what arguments to put ....
root@nagios:/usr/local/nagios/libexec# ./check_nrpe -H 172.25.1.101 -c check_raid
scripts/check_smartarray.ps1 : AuthorizationManager check failed.
At line:1 char:1
+ scripts/check_smartarray.ps1; exit $LastExitCode
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

Re: SMART

Posted: Fri Aug 16, 2013 12:31 pm
by slansing
Are you able to run this Powershell script on the Windows server manually? Looks like it may be an issue on the windows end now.

Re: SMART

Posted: Tue Aug 20, 2013 12:59 am
by MPIvan
Hi,

here is what iv got when i execute the check_smartarray.ps1 from powershell run as administrator, first i execute like check_smartarray.ps1 and have errors then i execute with .\check_smartarray.ps1 and i have something ...
PS C:\Program Files\NSClient++\scripts> check_smartarray.ps1
check_smartarray.ps1 : The term 'check_smartarray.ps1' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ check_smartarray.ps1
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (check_smartarray.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


Suggestion [3,General]: The command check_smartarray.ps1 was not found, but does exist in the current location. Windows
PowerShell does not load commands from the current location by default. If you trust this command, instead type ".\check
_smartarray.ps1". See "get-help about_Command_Precedence" for more details.
PS C:\Program Files\NSClient++\scripts> .\check_smartarray.ps1

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. Do you want to run C:\Program Files\NSClient++\scripts\check_smartarray.ps1?
[D] Do not run [R] Run once Suspend [?] Help (default is "D"): R
& : The term 'C:\Program Files (x86)\Compaq\Hpacucli\Bin\hpacucli.exe' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At C:\Program Files\NSClient++\scripts\check_smartarray.ps1:163 char:11
+ $exec = & $prg 'ctrl all show config'
+ ~~~~
+ CategoryInfo : ObjectNotFound: (C:\Program File...in\hpacucli.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

OK - RAID status is good
PS C:\Program Files\NSClient++\scripts>


and when i run the smartpfa.vbs it pops out one box and it says OK: No pfa/S.M.A.R.T errors detected

PS C:\Program Files\NSClient++\scripts> .\smartpfa.vbs
PS C:\Program Files\NSClient++\scripts>

Re: SMART

Posted: Tue Aug 20, 2013 1:51 pm
by sreinhardt
It would seem you did not define your check_raid as lmiltchev defined, this should no longer be executing the powershell script, but the smartpfa.vbs. Please follow his steps above and test again.

Re: SMART

Posted: Fri Aug 30, 2013 3:11 am
by MPIvan
Hmm, i didnt do anything except i restart the NSClient++. I didnt change nothing ( it was exactly like lmiltchev sasy to be ) in nsclient.ini file. And when i execute the command i have the following:
root@nagios:/usr/local/nagios/libexec# ./check_nrpe -H 172.25.1.101 -c check_raid
OK : No PFA/S.M.A.R.T errors detected
root@nagios:/usr/local/nagios/libexec#
I dont know what arguments to put . I just execute this line. "./check_nrpe -H 172.25.1.101 -c check_raid "

Re: SMART

Posted: Fri Aug 30, 2013 1:14 pm
by sreinhardt
Actually, that looks perfect! The results are what I would expect to see. Are you looking for something different?

Re: SMART

Posted: Tue Sep 03, 2013 4:04 am
by MPIvan
Hi sreinhardt,
sorry for late reply, I have other high priority problems and tnx for helping me. Any way, i dont know way i chose this plug in. Because in the description of this plugin says that it is for "Powershell script to check HP SmartArray RAID status on Windows". So what does "HP SmartArray means" ? But any way we are using Dell PC everywhere (with windows on it), is this plugin give me true result or not? And i would like to suggest some plugin that will gave me the health of the disk or SMART status. Im a lost a little bit for everything here and i will need a little help for this job.

Re: SMART

Posted: Tue Sep 03, 2013 11:04 am
by slansing
You need be sure to read what the plugin actually does before spending 3 pages trying to implement something that will not work in the first place... HP Smart Arrays WILL NOT work with your dell systems. Please verify the plugins you are trying to use before downloading them and asking for help. Once you find a plugin which will function with your specific hardware and systems then we can help you to implement it.