APC UPS Data Center & Enterprise Solutions Forum
Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:35 AM . Last Modified: 2024-03-18 01:18 AM
I've been looking around for what seems like an eternity for a simple script that will turn off an outlet on my PDU and can't find anything of value. I can however find how to do it SNMP but this does not meet my needs. People keep mentioning doing via the CLI but I can't seem to find a clear example on it. I currently have a Smart-ups VT-30 with 8 AP7990 PDUs in my datacenter. I need a script that I can fire off from my environmental monitoring server that will shut down individual outlets on the PDU's. Something in VB would be great. If someone could share their solution I would really appreciate it. I was looking though this forum but couldn't come up with anything.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:36 AM . Last Modified: 2024-03-18 01:17 AM
Thanks for all the suggestions but I finally stepped back and just looked at it from a VB perspective and this is what I came up with. This is just a simple example on how to turn off a single outlet but since it is interacting with CLI you just have to step through it and choose what you want from the Menus and adjust the script. I hope it helps someone else.
Option Explicit
'On Error Resume Next
Dim WshShell
set WshShell=CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 500
'Telnet to PDU IP'
WshShell.SendKeys "telnet (Enter IP or host name here)"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Send Username
WshShell.SendKeys "username"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Send Password
WshShell.SendKeys "password"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Device Manager
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet Management
WshShell.SendKeys "2"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet control
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Enter to Continue
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet Selection
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Control Outlet
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Turn off Outlet
WshShell.SendKeys "2"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
WshShell.SendKeys "YES"
WScript.Sleep 500
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Turn on Outlet
'shShell.SendKeys "1"
'WshShell.SendKeys ("{Enter}")
'WScript.Sleep 500
'WshShell.SendKeys ("{YES}")
'WScript.Sleep 500
'WshShell.SendKeys ("{Enter}")
'WScript.Sleep 500
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:35 AM . Last Modified: 2024-03-18 01:18 AM
we also have some information in the knowledge base that may help
check article FA156163 @ http://www.apc.com/site/support/index.cfm/faq/
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:35 AM . Last Modified: 2024-03-18 01:18 AM
I don't have a great answer to your question but I am curious why SNMP doesn't meet your needs? You want something hard-wired? More secure?
While I don't have a ready-made script, you might want to try "expect". Take a look at [this tutorial|http://oreilly.com/catalog/expect/chapter/ch03.html] to get a flavor for how it works, and if you're in a windows environment, you can use [Expect for Windows|http://docs.activestate.com/activetcl/8.5/expect4win/].
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:35 AM . Last Modified: 2024-03-18 01:17 AM
Thank you so much for your reply. The reason SNMP wont do it for me is because I need to intiate it it from my environmental monitoring solution which isn''t from APC. I had an issue last year that was a little scarry. We lost power for an extended period and it shut down the AC. Problem was the APC kept things running great and shut down all my servers that run powerchute. Problem is that a have a multitude of devices that I can't shut down automatically and it got to be over 102 degrees in the datacenter and a couple devices actually cooked themselves. I'd like to be able to set a threshhold on the environmental server and have it run the script from within that application. SNMP may work I just might not have the know how. I've collected data from SNMP before but haven't forced a process. I will check out your suggestion and post back. Again, Thank you.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:36 AM . Last Modified: 2024-03-18 01:17 AM
>
The reason SNMP wont do it for me is because I need to intiate it it from my environmental monitoring solution which isn''t from APC.
>
Interesting. SNMP isn't tied to APC (in fact, PowerChute doesn't use it). It's a vendor-neutral standard and we document our command-set [in the PowerNet MIB|http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=SFPMIB405&tab=software] (scroll down to where it says PowerNet MIB). If your monitoring solution doesn't directly support SNMP, then perhaps the [Net-SNMP|http://www.net-snmp.org/] set of command-line tools would work for you.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 06:36 AM . Last Modified: 2024-03-18 01:17 AM
Thanks for all the suggestions but I finally stepped back and just looked at it from a VB perspective and this is what I came up with. This is just a simple example on how to turn off a single outlet but since it is interacting with CLI you just have to step through it and choose what you want from the Menus and adjust the script. I hope it helps someone else.
Option Explicit
'On Error Resume Next
Dim WshShell
set WshShell=CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 500
'Telnet to PDU IP'
WshShell.SendKeys "telnet (Enter IP or host name here)"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Send Username
WshShell.SendKeys "username"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Send Password
WshShell.SendKeys "password"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Device Manager
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet Management
WshShell.SendKeys "2"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet control
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Enter to Continue
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Outlet Selection
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Control Outlet
WshShell.SendKeys "1"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Turn off Outlet
WshShell.SendKeys "2"
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
WshShell.SendKeys "YES"
WScript.Sleep 500
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
WshShell.SendKeys ("{Enter}")
WScript.Sleep 500
'Turn on Outlet
'shShell.SendKeys "1"
'WshShell.SendKeys ("{Enter}")
'WScript.Sleep 500
'WshShell.SendKeys ("{YES}")
'WScript.Sleep 500
'WshShell.SendKeys ("{Enter}")
'WScript.Sleep 500
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.