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

Custom Sensor For EMC Storage Arrays

Votes:

10

After reading a few other posts on the KB regarding requests for better monitoring for EMC SAN arrays, I took it upon myself to create something that provided the data I personally wanted to see about my SAN. This script requires naviseccli to be installed and configured on the same system where the probe is running from.

This is based on the modified version of another very basic script by WayneJesse that monitors the individual disks in the SAN and reports on their health. The original discussion is here:

https://kb.paessler.com/en/topic/26423-emc-storage-array

However, this has been modified very extensively. In addition to reporting on physical disks for health/failure/rebuilding, you can now also display the free space in all storage pools, and the free space/health of all LUNs.

###############################################################################################
#	PRTG EMC San InfoScript v1.0
#	By Digitalhigh, 6/30/2016
###############################################################################################

<#
.SYNOPSIS

This is a custom PRTG script that will connect to NaviSecCli and enumerate system information for EMC Sans.  This has been tested with an EMC VNX5400.
.DESCRIPTION

Use this to populate the PRTG Exe/Script Advanced Sensor with EMC SAN information.  You can use this to display used capacity for all storage pools, used capacity for all LUNS, or status and count of physical disks.
You can show one or all of these fields, which is useful if you'd like multiple sensors for the various values.

There are a number of parameters that can be used to customize the data displayed, the parameters are described as follows.
.PARAMETER h

Specify the storage processor/SAN to connect to.  You can use hostname, IP address, or pass the PRTG variable %host to use the value set in PRTG.
.PARAMETER user

Specify the username to use.  Defaults to "sysadmin" if none specified.
.PARAMETER password

Specify the password to use.  Defaults to "sysadmin" if none specified.
.PARAMETER scope

Specifies whether the user account on the storage system you want to log in to is local or global. A 0 (default) indicates global; a 1 indicates local.
Defaults to 0 if none specified.
.PARAMETER lunwarnlevel

This value determines at what percentage of free space a warning will be issued for LUNs.  Default is 25 percent.
.PARAMETER lunerrorlevel

This value determines at what percentage of free space an error will be issued for LUNs.  Default is 10 percent.
.PARAMETER poolwarnlevel

This value determines at what percentage of free space a warning will be issued for storage pools.  Default is 25 percent.
.PARAMETER poolerrorlevel

This value determines at what percentage of free space an error will be issued for storage pools.  Default is 10 percent.
.PARAMETER showpools

Set this to 0 to hide pool data, 1 to display it.
.PARAMETER showluns

Set this to 0 to hide lun data, 1 to display it.
.PARAMETER showdisks

Set this to 0 to hide physical disk information, 1 to display it.

#>
param (    
	$h,
    [string]$user = "sysadmin",
    [string]$password = "sysadmin",
	[int]$scope = "0",
	[int]$lunwarnlevel = "25",
	[int]$lunerrorlevel = "10",
	[int]$poolwarnlevel = "25",
	[int]$poolerrorlevel = "10",
	[switch]$showpools,
	[switch]$showluns,
	[switch]$showdisks
	
)

$Query2 = & "C:\Program Files (x86)\EMC\Navisphere CLI\NaviSECCli.exe" ""-h $h -User $user -Password $password -scope $scope storagepool -list -consumedcap -availablecap""
$Query = & "C:\Program Files (x86)\EMC\Navisphere CLI\NaviSECCli.exe" ""-h $h -User $user -Password $password -scope $scope getdisk -state""
$Query3 = & "C:\program files (x86)\EMC\Navisphere CLI\Naviseccli.exe" ""-h $h -User $user -password $password -scope $scope lun -list -userCap -consumedCap""

write-host "<prtg>"

###############################################################################################
#	Pool Info Display
###############################################################################################
if ($showpools) {
	for ($i = 0; $i -lt $Query2.length; $i++) {
			if ([regex]::ismatch($Query2[$i],"Pool Name:")) {
				$PoolName = ($Query2[$i]).replace("Name:  ","LUN ")
				$PoolCapacity = ($Query2[$i+3]).replace("Consumed Capacity (GBs):  ","")
				$PoolUsed = ($Query2[$i+5]).replace("Available Capacity (GBs):  ","")
				$PoolFree = [Math]::round((($PoolUsed/$PoolCapacity) * 100))
				write-host "	<result>"
				write-host "		<channel>$PoolName Percent Free</channel>"
				write-host "		<value>$PoolFree</value>"
				write-host "		<unit>Percent</unit>"
				write-host "		<LimitMode>1</LimitMode>"
				write-host "		<LimitMinWarning>$poolwarnlevel</LimitMinWarning>"
				write-host "		<LimitMinError>$poolerrorlevel</LimitMinError>"
				write-host "	</result>"
			}
			
	}
}

###############################################################################################
#	Disk Info Display
###############################################################################################

if ($showdisks) {
	#Calculate the total number of disks
	$TotalDisks = (Select-String -InputObject $Query -Pattern "disk" -AllMatches).Matches.Count

	#Calculate the total number of Hot Spares
	$HotSpares = (Select-String -InputObject $Query -Pattern "hot" -AllMatches).Matches.Count

	#Calculate the number of disks in notable states
	$RebuildingDisks = (Select-String -InputObject $Query -Pattern "rebuilding|equalizing" -AllMatches).Matches.Count
	$FailedDisks = (Select-String -InputObject $Query -Pattern "failed|faulted|fault" -AllMatches).Matches.Count
	
	#PRTG service condition

	write-host "	<result>"
	write-host "		<channel>Total Disks</channel>"
	write-host "		<customunit>Disk(s)</customunit>"
	write-host "		<value>$TotalDisks</value>"
	write-host "		<ShowTable>0</ShowTable>"
	write-host "		<ShowChart>0</ShowChart>"
	write-host "	</result>"

	write-host "	<result>"
	write-host "		<channel>Hot Spare Disks</channel>"
	write-host "		<customunit>Disk(s)</customunit>"
	write-host "		<value>$HotSpares</value>"
	write-host "		<ShowTable>0</ShowTable>"
	write-host "		<ShowChart>0</ShowChart>"
	write-host "	</result>"

	If ($RebuildingDisks -gt 0) {
		write-host "	<result>"
		write-host "		<channel>Rebuilding Disks</channel>"
		write-host "		<customunit>Disk(s)</customunit>"
		write-host "		<value>$RebuildingDisks</value>"
		write-host "		<ShowTable>0</ShowTable>"
		write-host "		<ShowChart>0</ShowChart>"
		write-host "		<warning>1</warning>"
		write-host "	</result>"
	} ElseIf ($RebuildingDisks -eq 0) {
		write-host "	<result>"
		write-host "		<channel>Rebuilding Disks</channel>"
		write-host "		<customunit>Disk(s)</customunit>"
		write-host "		<ShowTable>0</ShowTable>"
		write-host "		<ShowChart>0</ShowChart>"
		write-host "		<value>0</value>"
		write-host "	</result>"
	}

	If ($FailedDisks -gt 0) {
		write-host "	<result>"
		write-host "		<channel>Failed Disks</channel>"
		write-host "		<customunit>Disk(s)</customunit>"
		write-host "		<value>$FailedDisks</value>"
		write-host "		<ShowChart>0</ShowChart>"
		write-host "		<ShowTable>0</ShowTable>"
		write-host "	</result>"
	} ElseIf ($FailedDisks -eq 0) {
		write-host "	<result>"
		write-host "		<channel>Failed Disks</channel>"
		write-host "		<customunit>Disk(s)</customunit>"
		write-host "		<ShowChart>0</ShowChart>"
		write-host "		<value>0</value>"
		write-host "		<ShowTable>0</ShowTable>"
		write-host "	</result>"
	}

}

###############################################################################################
#	Lun Info Display
###############################################################################################

if ($showluns) {

	$LunCount = 0

	for ($i = 0; $i -lt $Query3.length; $i++) {
		if ([regex]::ismatch($Query3[$i],"LOGICAL UNIT NUMBER")) {
				$LunCount += 1
		}
	}

	#Display Total LUNS
	write-host "	<result>"
	write-host "		<channel>Total Luns</channel>"
	write-host "		<value>$LunCount</value>"
	write-host "		<ShowTable>0</ShowTable>"
	write-host "		<ShowChart>0</ShowChart>"
	write-host "	</result>"

	#Enumerate and show percentage for LUNS
	for ($i = 0; $i -lt $Query3.length; $i++) {
		if ([regex]::ismatch($Query3[$i],"LOGICAL UNIT NUMBER")) {
			$LunName = ($Query3[$i+1]).replace("Name:  ","LUN ")
			$LunCapacity = ($Query3[$i+3]).replace("User Capacity (GBs):  ","")
			$LunUsed = ($Query3[$i+5]).replace("Consumed Capacity (GBs):  ","")
			$LunFree = [Math]::round((($LunUsed/$LunCapacity) * 100))
			if ($LunFree -le 25 -and $LunFree -ge 11 -and !$Error) {$Warn=1}
			ElseIf ($LunFree -le 10 ) {
				$Error=1
				$Warn=0
			}
			
			if ($LunFree -le 100) {
				write-host "	<result>"
				write-host "		<channel>$LunName Percent Free</channel>"
				write-host "		<value>$LunFree</value>"
				write-host "		<unit>Percent</unit>"
				write-host "		<LimitMode>1</LimitMode>"
				write-host "		<LimitMinWarning>$lunwarnlevel</LimitMinWarning>"
				write-host "		<LimitMinError>$lunerrorlevel</LimitMinError>"
				write-host "	</result>"
			} else {
				write-host "	<result>"
				write-host "		<channel>$LunName Percent Free</channel>"
				write-host "		<value>100</value>"
				write-host "		<unit>Percent</unit>"
				write-host "	</result>"
			}
						
		}
				
	}
}

if ($showdisks) {
	#PRTG message display
	If ($FailedDisks -eq 0 -and $RebuildingDisks -eq 0 -and $Error -eq 0 -and $Warn -eq 0) {
		write-host "	<text>All Disks OK</text>"
	} ElseIf ($FailedDisks -eq 0 -and $RebuildingDisks -gt 0) {
		write-host "	<text>WARNING $RebuildingDisks disk(s) rebuilding or equalising</text>"
	} ElseIf ($FailedDisks -gt 0) {
		write-host "	<text>FAILURE $FailedDisks disk(s) failed</text>"
		write-host "	<error>1</error>"
	}
}

if (!$showpools -and !$showdisks -and !$showluns) {
	write-host "	<text>ERROR - no display data selected, please select something to show.</text>"
	write-host "	<error>1</error>"
}

write-host "</prtg>"

Parameters:

-h : REQUIRED. This specifies the hostname/array to connect to. I recommend you use the value %host , this will pass the hostname or IP address you specified for the device in PRTG.

-user : Username. If none specified, it defaults to the system default of "sysadmin".

-password : Password. If none specified, it defaults to the system default of "sysadmin".

-scope : Login Scope. Can either be 0 for global, or 1 for local. Defaults to "0" if none specified.

-lunwarnlevel : The percentage to display a warning for Lun free space. Default is 25.

-lunerrorlevel : The percentage to display an error for Lun free space. Default is 10.

-poolwarnlevel : The percentage to display a warning for Storage pool free space. Default is 25.

-poolerrorlevel : The percentage to display an error for Storage pool free space. Default is 10.

-showpools : Flag to display storage pool information.

-showluns : Use this flag to display LUN information.

-showdisks : Use this flag to display disk information.


Notes:

  • You can display pool, lun, and disk information in one sensor using all three -show flags, or show the information in individual sensors. If you choose to display all information at once, please note that there is a recommended limit of 50 channels per sensor, and that PRTG has stated that more channels than this could cause issues.
  • For my SAN, this is not an issue, but for users with more than 50 LUNS/Storage pools, this may be problematic.
  • You may run into security issues with NaviSecCli if it's security mode is set to "medium". Please refer to the following link on how to change the certificate security level in NaviSecCli if you have issues or you're not sure.

http://www.pragmaticio.com/2015/04/emc-certificate-issues-after-naviseccli-upgrade/

  • The position of parameters is not mandatory - any can be specified at any position.
  • The only parameters you HAVE TO specify is the host address and at least one dataset to display. And actually, you don't have to display any data, but you'll get an error if you don't pick something.
  • I'm open to requests, suggestions, pointing out mistakes I've made, etc. I could have stopped working on this after I got it running last night, but I deliberately tried to make this more universal and more flexible so that it could be used to meet anybody's use-case scenario. But, I've only got one EMC San to test against, and it's not the biggest one out there, so there may be other things people want to see. I've got this down pretty well now, so if there's data I don't have in here, LMK, and I'll be happy to try and accommodate.

Examples:

Pass the hostname from PRTG, use default credentials and scope, show disk status only:

-h %host -showdisks

Pass an IP, username, password; use local scope; show disk status and LUN freespace:

-h 192.168.1.33 -user bob -password BobRox666 -scope 1 -showdisks -showluns

Use custom warning and error levels for luns, show all info:

-h %host -lunwarnlevel 20 -lunerrorlevel 5 -showluns -showdisks -showpools


Photos:

Lun Freespace

Storage Pool Freespace

Disk Health

emc san vnx

Created on Jun 30, 2016 5:21:09 PM

Last change on Jul 1, 2016 6:51:32 AM by  Torsten Lindner [Paessler Support]



10 Replies

Votes:

0

Hi!

I configured my probe to get the data from my EMC VNX5200.
The sensor is working, but, I'm getting wrong values.

I added a Sensor EXE/Script customized running the powershell script with the parameters.

The "Total Disks" channel is wrong. I have only 24 disks, and the sensor returns 50 disks - Wrong.
The channel "Pool XXX Percent free" returns 0(zero) - Wrong.
All channels "LUN XXX Percent free" returns "100%" - Wrong.

Do you have any idea where can be the problem?

Kind Regards
Jefferson Jesus

Created on Oct 26, 2016 5:32:19 PM

Last change on Oct 27, 2016 6:11:10 AM by  Luciano Lingnau [Paessler]



Votes:

0

Hello Jefferson,
thank you for your post.

Now, since this is a custom script we're rather limited in the support we can provide, but the author of the script may be able to assist.

I would advise that you copy the whole code into Powershell's ISE on the Remote Probe and run the code within the ISE, that will allow you to debug/troubleshoot the code and may give you a hint about why it's displaying the wrong values. Essentially, since this relies on Naviseccli.exe the most likely explanation is that your device has a different output format which the "parser" within the script isn't able to decode correctly.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Oct 27, 2016 7:10:10 AM by  Luciano Lingnau [Paessler]



Votes:

0

Greetings,

Can I get a custom script to monitor Infortrend EonStorDS 4000 Series HMN v1.6, EonStorDS 3000 Series HMN v1.2 and ESDS 4000 Series QIG v1.6 and Quantum i500 Tape Library?

Best Regards. Frank.

Created on Dec 14, 2016 1:49:39 PM



Votes:

0

Can I use the above custom script to monitor the storage controllers of Infortrend EonStorDS 4000 Series HMN v1.6, EonStorDS 3000 if I edit the scripts and add Infortrend CLI and other parameters else can someone guide me on this.

Created on Dec 15, 2016 8:25:31 AM



Votes:

0

Update: As of version 18.1.37, PRTG includes 5 sensor types that enable you to monitor your Dell EMC storage systems out of the box! The sensors use the REST API of Dell EMC devices to show you health status and other important measurements of your Dell EMC storage components.

Created on Mar 9, 2018 5:31:29 PM by  Gerald Schoch [Paessler Support]



Votes:

5

It's important to note that the new PRTG Sensors only work with the newest EMC systems that have a REST API, namely Unity and Above. Those of us with Clariion/Celerra/VNX/VNX2 systems still must use the legacy methods.

Created on Jul 31, 2018 9:58:38 PM



Votes:

0

Hi digitalhigh

What do you mean by "The only parameters you HAVE TO specify is the host address and at LEAST ONE DATASET TO DISPLAY? On the script where I can specify the dataset? I adapted the script to my reality, but as I am no script expert, I cannot understand how and where to specify the dataset to display. When I run the script I have as an end result "ERROR - no display data selected, please select something to show". Thank you in advance

Created on Nov 12, 2019 9:42:37 AM



Votes:

0

Hi there
I installed NaviSecCLI.exe on my PRTG server that has access to EMC VNX Storage and also set "Unristricted" for ExecutionPolicy in my both x86 and x64 PowerSehll and placed this script in my EXEXML folder,
but,
it result in this:
"ERROR - no display data selected, please select something to show." While when i execute those 3 queries (that are in first of script) in a cmd separately, they work fine and return correct results.
Also i set "Write EXE result to disk" but it also logs:

<prtg>
	<text>ERROR - no display data selected, please select something to show.</text>
	<error>1</error>
</prtg>

Can anybody help on this?
Any help would be greatly appreciated.

Created on May 17, 2020 11:31:16 AM

Last change on May 18, 2020 4:11:32 AM by  Sven Roggenhofer [Paessler Technical Support]



Votes:

0

Hi Hossein,

I'm afraid I'm not able to help you here as this is a custom script.

Did you try our native EMC Storage sensors already? Please find more information here.


Kind regards,
Andreas Günther
Tech Support, Paessler AG

[email protected]

Created on May 18, 2020 8:26:10 AM by  Andreas Günther [Paessler Support]



Votes:

0

Hi Andreas,

Thanks for your reply,

I know the new abilities of the PRTG in REST APIs and its new sensors for storage, but as jgrote mentioned above:

"the new PRTG Sensors only work with the newest EMC systems that have a REST API, namely Unity and Above. Those of us with Clariion/Celerra/VNX/VNX2 systems still must use the legacy methods."

Of course, I did not test this myself and I am not sure about it.
You can probably comment on this better.

And about my post, I actually asked the question about the script hoping that get an answer from digitalhigh...

Best Regrads

Created on May 18, 2020 9:16:48 AM

Last change on May 19, 2020 9:46:12 AM by  Andreas Günther [Paessler Support]




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.