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:
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?
nj1250
1 Message
0
January 21st, 2013 09:00
MHL2
16 Posts
0
November 24th, 2013 04:00
soooooo cool !
MHL2
16 Posts
1
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();
}
bernhardm
1 Message
0
March 17th, 2014 09:00
nice script!
Giuseppe_Andrea
8 Posts
2
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