Hello
I have RealPresence Resource Manager 10.9.0_47
I have multiple endpoint types as follows: Group series 500, Group series 700, Studio X50 and GS7500, all with current firmware updates as of this posting.
Is there any way to schedule automatic Endpoint restarts using Resource Manager? And if so, How would I go about doing this ?
Hello @Richard_G ,
Welcome to the Poly Community.
I do not think there is a built in method in doing this in a scheduled manner.
You could potentially use the RPRM REST API or look into using the REST API with a file with the IP's and the Password for the Group Series.
Example using CURL (Windows 10 supports this via the command line)
@echo off
echo Reading IP_Pass.txt
for /F "tokens=1,2 delims=," %%a in (IP_Pass.txt) do (
curl -b cookies.txt -c cookies.txt -X POST -d "{\"action\": \"Login\",\"user\": \"Admin\",\"password\": \"%%b\"}" -H "Content-Type: application/json" -k https://%%a/rest/session
curl -b cookies.txt -c cookies.txt -X POST -d "{\"action\": \"reboot\"}" -H "Content-Type: application/json" -k https://%%a/rest/system
timeout /t 5 /NOBREAK
)
or using Power Shell:
#BEGIN POWERSHELL SCRIPT FOR REBOOTING Poly GroupSeries command
$File = get-content "c:\temp\restapi\IP_Pass.txt"
foreach ($line in $File){
$Arr = $line.Split(',')
[array]
#URL to make new session
$sessionURL = ("https://" + $Arr[0] + "/rest/session");
#Command to make new session
$sessionBody = "{`"action`": `"Login`",`"user`": `"admin`",`"password`": `"" + $Arr[2] + "`"}"
#URL to issue reboot
$rebootURL = ("https://" + $Arr[0] + "/rest/system");
#Command to issue reboot
$rebootBody = "{`"action`": `"reboot`"}"
# disable self signed certificate check
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type)
{
$certCallback = @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
if(ServicePointManager.ServerCertificateValidationCallback ==null)
{
ServicePointManager.ServerCertificateValidationCallback +=
delegate
(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors
)
{
return true;
};
}
}
}
"@
Add-Type $certCallback
}
[ServerCertificateValidationCallback]::Ignore()
# End self signed certificate commands
Invoke-WebRequest $sessionURL -ContentType "application/json" -Method Post -body $sessionBody -SessionVariable sess;
Invoke-WebRequest $rebootURL -ContentType "application/json" -Method Post -WebSession $sess -Body $rebootBody
}
both methods will expect a file called IP_Pass.txt with the IP and the password separated by a comma.
Please note that I just hacked these together and can provide no support!
Examples for Studio X and G7500 can be found >here<
Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.
Best Regards
Steffen Baier
If official support is required please check how to phone or open a case here
----------------