1 Message

January 21st, 2013 09:00

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!

16 Posts

November 24th, 2013 04:00

soooooo cool !

16 Posts

November 24th, 2013 04:00

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();

            }

1 Message

March 17th, 2014 09:00

nice script!

February 4th, 2015 23:00

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

No Events found!

Top