Powershell scripts for VPlex performance monitoring

This post contains scripts that allow you to monitor EMC VPlex clusters with powershell.  There are examples and parameters contained in the powershell script that give good examples of how to run the scripts.  As well, see the attached screenshots which give examples as well.

As a side note, there is a REST function within the powershell script that can be reused to implement any available REST call from the API documentation.

Labels (1)
5 Replies
nj1250
1 Copper

Re: Powershell scripts for VPlex performance monitoring

Thanks for the excellent post! I am trying to get a cluster configdump from VPlex using the REST API. I am using PowerShell v3.0 which simplifies making web requests with the Invoke-RestMethod command. Here is what I am trying to do:
$header = @{'Username' = $username; 'Password' = $password}
$result = Invoke-RestMethod 'https://7.32.212.40/vplex/cluster+configdump' -Headers $header -Method Post -Body '{ "args" : "-c cluster1"}'
I get back error 524 from the server. Other commands such as "ls" work fine with arguments. Not sure what the problem is. I just want to get the configdump via REST. It does not matter whether I use Invoke-RestMethod or WebClient. Can you please help?
Thanks!
0 Kudos
MHL2
1 Nickel

Re: Powershell scripts for VPlex performance monitoring

soooooo cool !

0 Kudos
MHL2
1 Nickel

Re: Powershell scripts for VPlex performance monitoring

C# code

ServicePointManager.ServerCertificateValidationCallback= ValidateServerCertificate;

            Uriaddress = newUri("https://IP/vplex/cluster configdump");

            HttpWebRequestrequest = HttpWebRequest.Create(address) asHttpWebRequest;

            //request.Headers.Add("Content-Type","application/json");

            request.Headers.Add("username", "service");

            request.Headers.Add("password", "Pass");

            //stringparamData = "{\"args\":\"cluster configdump\"}";

            stringparamData = "{\"args\":\"-ccluster-1\"}"; ;           

            request.Credentials = newNetworkCredential("service", "Pass");

            request.Method = "POST";         

            Encodingencoding = Encoding.UTF8;           

            byte[]postData = encoding.GetBytes(paramData);

            request.ContentLength =postData.Length;

            StreamrequestStream = request.GetRequestStream();

            requestStream.Write(postData, 0,postData.Length);

            using(HttpWebResponse response =request.GetResponse() asHttpWebResponse)

            {

                StreamReaderreader = newStreamReader(response.GetResponseStream());

               Response.Write(reader.ReadToEnd());

                Response.End();

            }

Highlighted
bernhardm
1 Copper

Re: Powershell scripts for VPlex performance monitoring

nice script!

0 Kudos

Re: Powershell scripts for VPlex performance monitoring

Nice script but I find a better way ... maybe :-)

Use RestAPI and try to connect to SRM DataBase directly or, moreover, user SNMP !!

for example "snmpwalk -v2c -c public "IP" 1.3.6.1.4.1.1139.21.2.2.4.1.5 (OID MIB are online or on the vplex )

Try, it's very good and simple !

After then, You can put the data in a mysql DB and make a "own" graph, with Zabbix for example

bye

0 Kudos