How can I monitor IBM Storwize 7000 with PRTG, given that I have difficulty with Perl and can't find clear documentation on the XML performance files?
PREREQUISITES: Create a keypair with puttygen. Place the privatekey in c:\sanmon Create a file with a single n in it, and call it answer.txt and place it in c:\sanmon Copy the public key to the san: scp superuser@SANIP:/tmp/tmpkey (this can't be done with WinSCP, so I copied it from a linux box) Create an administrator user on the san called prtgmon plink SANIP -l superuser "svctask mkuser -name prtgmon -usergrp Administrator -keyfile /tmp/tmpkey" (It will ask if you want to cache the RSA fingerprint, answer N).
Place this script in PRTG\Custom Sensors\EXE
@ECHO OFF Rem This script will get capacity information from StorWiz REM V1.02 Kenneth Fribert REM PREREQUISITES: REM Needs a folder on C: drive called sanmon, where the user running the script needs read / write / delete access REM Parameters: REM 1: ID REM 2: Name REM 3: Status REM 4: Mdisk Count REM 5: Vdisk Count REM 6: Capacity * REM 7: Extent Size REM 8: Free Capacity * REM 9: Virtual Capacity REM 10: Used Capacity REM 11: Real Capacity REM 12: Overallocation * IF %1.==. GOTO Error_Missing_Argument IF %2.==. GOTO Error_Missing_Argument IF %3.==. GOTO Error_Missing_Argument SET IP=%1 SET STORID=%2 SET CHECK=%3 SET FILENAME=%IP:.=-%-%STORID%-%CHECK% plink %IP% -l prtgmon -ssh -i c:\sanmon\prtgsanmon.ppk -noagent "svcinfo lsmdiskgrp -nohdr -bytes -delim :" 2>NUL 1> c:\sanmon\%FILENAME% < c:\sanmon\answer.txt for /F "eol=; tokens=1,%CHECK% delims=:" %%i in (c:\sanmon\%FILENAME%) do ( IF "%%i" == "%STORID%" ( ECHO %%j:ok ) ) EXIT /B 0 :Error_Missing_Argument ECHO 0:The command takes three arguments prtgsanmon SANIP STORAGEID CHECK EXIT 2
The current sensor needs to have a MUTEX set, there is no check for multiple instances, it will however work for multiple checks, as it creates individual temp files. I tried getting rid of the temporary file, by including the plink command in '' in the for sentence, but that didn't work. I would very much like to get rid of the temporary filename.
Disclaimer:
The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.