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.
Posted: 2021-06-28 02:47 AM . Last Modified: 2024-02-14 10:46 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-28 02:47 AM . Last Modified: 2024-02-14 10:46 PM
Where can I find applescript examples or solutions for remote login and manipulation of an APC 7900 or similar? The supported resources for Macintosh users are slim. Thanks.
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 02:47 AM . Last Modified: 2024-02-14 10:46 PM
I'm not familiar with the capabilities of the APC 7900. I will try to address the more general question of how to manipulate APC devices using AppleScript.
The best approach I know of for programmatically manipulating APC devices is through SNMP. MacOS X ships with SNMP software built-in. This blog article seems to have a thorough description of the technology: [A Primer to SNMP on Mac OS X 1.5|http://www.bynkii.com/archives/2007/12/a_primer_to_snmp_on_mac_os_x_1.html]
You can use the command line SNMP programs with the various programming tools shipped with MacOS X, such as Python, Perl, Ruby, and AppleScript. This technote seems to describe how to use command line programs such as the SNMP suite with AppleScript: [TN2065: Do Shell Script in AppleScript|http://developer.apple.com/technotes/tn2002/tn2065.html]
So lets say I want to command a switched PDU to turn off all outlets. If it supports the sPDUMasterControlSwitch OID (1.3.6.1.4.1.318.1.1.4.2.1) then I should be able to do something like this (with ip_goes_here replaced with appropriate IP):
do shell script "/usr/bin/snmpset -c private -v 1 ip_goes_here 1.3.6.1.4.1.318.1.1.4.2.1.0 i 7"
then to turn them back on:
do shell script "/usr/bin/snmpset -c private -v 1 ip_goes_here 1.3.6.1.4.1.318.1.1.4.2.1.0 i 1"
You may need to change the snmp version (-v), the community string (-c), or other options for your setup. If you're using SNMPv1, I'd suggest you get it working with that and then move to SNMPv3 for security.
If you have any further questions, let us know.
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 02:47 AM . Last Modified: 2024-02-14 10:46 PM
I'm not familiar with the capabilities of the APC 7900. I will try to address the more general question of how to manipulate APC devices using AppleScript.
The best approach I know of for programmatically manipulating APC devices is through SNMP. MacOS X ships with SNMP software built-in. This blog article seems to have a thorough description of the technology: [A Primer to SNMP on Mac OS X 1.5|http://www.bynkii.com/archives/2007/12/a_primer_to_snmp_on_mac_os_x_1.html]
You can use the command line SNMP programs with the various programming tools shipped with MacOS X, such as Python, Perl, Ruby, and AppleScript. This technote seems to describe how to use command line programs such as the SNMP suite with AppleScript: [TN2065: Do Shell Script in AppleScript|http://developer.apple.com/technotes/tn2002/tn2065.html]
So lets say I want to command a switched PDU to turn off all outlets. If it supports the sPDUMasterControlSwitch OID (1.3.6.1.4.1.318.1.1.4.2.1) then I should be able to do something like this (with ip_goes_here replaced with appropriate IP):
do shell script "/usr/bin/snmpset -c private -v 1 ip_goes_here 1.3.6.1.4.1.318.1.1.4.2.1.0 i 7"
then to turn them back on:
do shell script "/usr/bin/snmpset -c private -v 1 ip_goes_here 1.3.6.1.4.1.318.1.1.4.2.1.0 i 1"
You may need to change the snmp version (-v), the community string (-c), or other options for your setup. If you're using SNMPv1, I'd suggest you get it working with that and then move to SNMPv3 for security.
If you have any further questions, let us know.
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.