Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Remote shutdown on OS 6?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-05-13
06:24 PM
2013-05-13
06:24 PM
Remote shutdown on OS 6?
Is there a way to do a remote shutdown on OS 6?
I found this for older versions: viewtopic.php?p=94750
but nothing for OS 6.
I found this for older versions: viewtopic.php?p=94750
but nothing for OS 6.
Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-05-13
07:20 PM
2013-05-13
07:20 PM
Re: Remote shutdown on OS 6?
They switched to XML.
This should work:
curl -u admin:password -k "https://IP_OF_NAS/dbbroker" -H "Content-Type: application/x-www-form-urlencoded;" -H "X-Requested-With: XMLHttpRequest" --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <xs:nml xmlns:xs=\"http://www.netgear.com/protocol/transaction/NMLSchema-0.9\" xmlns=\"urn:netgear:nas:readynasd\" src=\"dpv_1368497621000\" dst=\"nas\"> <xs:transaction id=\"njl_id_1278\"> <xs:custom id=\"njl_id_1277\" name=\"Halt\" resource-id=\"Shutdown\" resource-type=\"System\"> <Shutdown halt=\"true\" fsck=\"false\"/> </xs:custom> </xs:transaction> </xs:nml>"
Message 2 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-05-13
07:22 PM
2013-05-13
07:22 PM
Re: Remote shutdown on OS 6?
Easy way to sniff XML for ReadyNAS via Google Chrome browser...
Open Dashboard, then in Chrome choose Tools>Developer Tools. Click on the Network tab in that Inspector. It will show you all network calls. Run the command you want, and find the related dbbroker call for it. You can then 'Copy to curl' in the right-click menu to get a working curl call for it.
Open Dashboard, then in Chrome choose Tools>Developer Tools. Click on the Network tab in that Inspector. It will show you all network calls. Run the command you want, and find the related dbbroker call for it. You can then 'Copy to curl' in the right-click menu to get a working curl call for it.
Message 3 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-05-13
07:45 PM
2013-05-13
07:45 PM
Re: Remote shutdown on OS 6?
Works perfectly. Thank you!
Great tip about the network inspector in Chrome, too. Very convenient. And here I was looking for the call in javascript.
Thanks again!
Great tip about the network inspector in Chrome, too. Very convenient. And here I was looking for the call in javascript.
Thanks again!
Message 4 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2014-01-09
04:44 PM
2014-01-09
04:44 PM
Re: Remote shutdown on OS 6?
Thank you very much chirpa, I was able to find the Chrome way by myself but I was missing the right CURL syntax.
My Readynas is a NV+ V2 so I suppose is OS5. Anyway xml syntax is almost identical. This is my working CURL command (xml captured with chrome dev tools):
curl -s -v -u admin:password -k "https://IP_OF_NAS/dbbroker" -H "Content-Type: application/x-www-form-urlencoded;" -H "X-Requested-With: XMLHttpRequest" --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <xs:nml xmlns:xs=\"http://www.netgear.com/protocol/transaction/NMLSchema-0.9\" xmlns=\"urn:netgear:nas:readynasd\" src=\"dpv_1389313459000\" dst=\"nas\"> <xs:transaction id=\"njl_id_725\"> <xs:custom id=\"njl_id_724\" name=\"Halt\" resource-id=\"Shutdown\" resource-type=\"System\"> <Shutdown halt=\"true\" fsck=\"false\"/> </xs:custom> </xs:transaction> </xs:nml>"
Message 5 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-10-27
12:55 AM
2015-10-27
12:55 AM
Re: Remote shutdown on OS 6?
For the 6.4.0 OS:
curl -u admin: password -k "https://IP_OF_NAS/dbbroker" -H "Content-Type: application/x-www-form-urlencoded;" -H "X-Requested-With: XMLHttpRequest" --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xs:nml xmlns:xs=\"http://www.netgear.com/protocol/transaction/NMLSchema-0.9\" xmlns=\"urn:netgear:nas:readynasd\" src=\"dpv_1445852944000\" dst=\"nas\"><xs:transaction id=\"njl_id_2269\"><xs:custom id=\"njl_id_2268\" name=\"Halt\" resource-id=\"Shutdown\" resource-type=\"System\"><Shutdown halt=\"true\" fsck=\"false\"/></xs:custom></xs:transaction></xs:nml>"
Message 6 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-04-03
11:45 PM
2016-04-03
11:45 PM
Re: Remote shutdown on OS 6?
How about directly from PowerShell instead of having to install cURL? How would one convert all of those cURL options into a PowerShell Invoke-RestMethod CmdLet?
Message 7 of 8
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-09-05
05:23 PM
2016-09-05
05:23 PM
Re: Remote shutdown on OS 6?
This is a little bit late, but here's how to do it in PowerShell 3+:
$Hostname = "readynas" $Username = "username" $Password = ConvertTo-SecureString "password" -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential($Username, $Password) $Headers = @{ "Content-Type" = "application/x-www-form-urlencoded"; "X-Requested-With" = "XMLHttpRequest" } $Xml = '<?xml version="1.0" encoding="UTF-8"?><xs:nml xmlns:xs="http://www.netgear.com/protocol/transaction/NMLSchema-0.9" xmlns="urn:netgear:nas:readynasd" src="dpv_1368497621000" dst="nas"><xs:transaction id="njl_id_1278"><xs:custom id="njl_id_1277" name="Halt" resource-id="Shutdown" resource-type="System"><Shutdown halt="true" fsck="false"/></xs:custom></xs:transaction></xs:nml>' $Uri = "https://$Hostname/dbbroker" Add-Type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public bool CheckValidationResult( ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { return true; } } "@ [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy Invoke-RestMethod -Credential $Credential -Headers $Headers -Uri $Uri -Method Post -Body $Xml
Message 8 of 8