New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Custom Sensor For EMC Storage Arrays

Votes:

10

Your Vote:

Up

Down

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 by  digitalhigh (10) 1

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



6 Replies

Votes:

0

Your Vote:

Up

Down

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 by  jfjesus99 (0)

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



Votes:

0

Your Vote:

Up

Down

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 Support]



Votes:

0

Your Vote:

Up

Down

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 by  Frank Uchehara (0) 1



Votes:

0

Your Vote:

Up

Down

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 by  Frank Uchehara (0) 1



Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  jgrote (70)



Please log in or register to enter your reply.


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.