What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Monitoring an IBM StorWize - script/snmp what to do?

Votes:

0

We have a rather large storwize 7000 here, and we need to monitor it. I've found how to do it Nagios (https://www.bityard.org/blog/2013/12/28/nagios_monitoring_ibm_svc_storwize) so it is possible to do it. Alas perl is absolutely not my strong suit, so I can't translate it into something usefull for prtg. I can see that you have been asked this before, but I don't see much help in the replies or in the references in them. I've also found a way to download performance files from the storwize, but I can't get my head around the XML files and what each key means, and I can't find a description of what the keys mean or an xml schema explanation anywhere. Has anybody gotten this set up with PRTG, or did you just give up on it?

capacity monitor storwize

Created on May 18, 2017 2:19:19 PM



Best Answer

Accepted Answer

Votes:

0

Now it seems to be working as it should.

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 curent 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.

Created on May 30, 2017 11:40:22 AM

Last change on May 30, 2017 11:52:34 AM by  Dariusz Gorka [Paessler Support]



14 Replies

Votes:

0

Hi there,

Unfortunately, I can't reach the linked website with the nagios script. But, you can try to monitor the Storage with the following guide: https://kb.paessler.com/en/topic/69772-v7000-ibm-monitoring

Best regards.

Created on May 19, 2017 11:44:10 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

I have not had one of these for a few years, but this is a script i used to have to SSH to the box, run a command and return the value.

If i remember it returned MBps.

CMD = "f:\utils\plink superuser@v7000IP -pw passw0rd ""svcinfo lssystemstats -nohdr -filtervalue stat_name=mdisk_r_mb"""


Set objShell = WScript.CreateObject("WScript.Shell")
Set objExec = objShell.Exec(cmd)
Do
    line = objExec.StdOut.ReadLine()
    s = s & line & vbcrlf
Loop While Not objExec.Stdout.atEndOfStream

WScript.Echo split(s)(1)

I will leave it with you on how to change this to a per array solution.

Also, let us know if SNMP works, there was no SNMP in version 1 of a v7000 (around 2013)

Created on May 22, 2017 5:46:40 AM

Last change on May 22, 2017 8:59:11 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi Andrew,

Thank you for the script, maybe someone will be able to try it out. :)

Created on May 22, 2017 9:00:01 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi AndrewG, that looks very interesting. I'll have a look at it, thankyou!

Created on May 23, 2017 10:44:54 AM



Votes:

0

Hmm, I can't seem to get storage capacity out with that, I can find all sorts of buffer overview, and queing and stuff like that, but the most logical is how close the SAN is to being full, and I can't seem to find that with any of the different 'ls' commands?

Created on May 24, 2017 7:33:59 AM



Votes:

0

Hi there,

Andrew, do you have any idea if the storage size is actually offered as a metric by the SAN?

Best regards.

Created on May 24, 2017 9:08:50 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Sorry guys, I don't have that SAN anymore and I have no idea what type of data it returned.

And from memory I did not monitor the free space, but then again I have a habit of pre allocating everything to VMWARE, then monitor the datastore.

Created on May 29, 2017 12:23:31 AM



Votes:

0

Ok, I got some work done, and actually made a BAT script that gave me all the info I want. I want to turn it into a custom sensor. The script takes three arguments. SANIP StorageID CHECK It returns a single value. If I run it by hand it works.

The script stores the output of a command to a file, and then reads from that file to interpret the output. The problem is that as soon as I add the custom sensor to PRTG, the temporary file is locked, so it can't read from it, or update it with new values. The 'arguments' I've given to the sensor are "%host 3 6"

I've set up Semaphore in PRTG to make sure it doesn't accidently run twice at the same time. I've also made the script so it should delete the file as soon as it's read and interpreted.

Created on May 29, 2017 12:53:38 PM



Votes:

0

Hi there,

Do you want to publish it, so you can help the other people? :)

Best regards.

Created on May 29, 2017 1:45:47 PM by  Dariusz Gorka [Paessler Support]



Accepted Answer

Votes:

0

Now it seems to be working as it should.

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 curent 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.

Created on May 30, 2017 11:40:22 AM

Last change on May 30, 2017 11:52:34 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi Kenneth,

Thank you for the work. Hopefully it will help others too. :)

Best regards.

Created on May 30, 2017 11:53:38 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hello Kenneth, how did you make this, maybe i understand you wrong.

(this can't be done with WinSCP, so I copied it from a linux box)?

How does the script got data from the storewiz? Over ssh?

kindly regards

Jens

Created on Aug 31, 2018 12:50:38 PM



Votes:

0

Hello Kenneth,

thank you for your script. 2 questions i have:

1. Create a keypair with puttygen on the Prtg server? or doesn´t matter on which pc. 2. How should i understand it? "so I copied it from a linux box" from an other linux server to the StorWiz?

Thank you Jens

Created on Sep 3, 2018 5:38:22 AM



Votes:

1

Does anyone have this script working? I am looking to monitor 2 StoreWize V5000 units and can't figure this one out.

Created on Dec 3, 2019 7:14:33 PM




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.