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-30 06:09 AM . Last Modified: 2024-03-08 01:30 AM
Hi there,
I'm working on an application that will be able to control power switches located on the rack power distribution unit application. Is there anyway to whitelist my angular front end application so that i can make post and get requests to the rack power distribution unit application apis? I tried calling the apis but keep getting an "No Access-Control_Allow-Headers" error. I looked further into this and it seems my frontend requires a nmc object key that is used in the endpoint. (e.g http://xxx.xx.xxx.xx/NMC/kQtlr8AEz8bRMchJ73RGiA/home.htm . But I'm not sure on how to retrieve this key as I assume this key is retrieved when logging into the application. I also tried calling the login apis first but still get Access-Control-Allow-Headers errors. Any help would be great.
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
That's not really how SNMP works.
The commands are standard for all SNMP devices the only thing that changes is the target OID and the value set. The list of OIDs associated with the PDUs can be found in the Powernet MIB. (Like I said you'd need to be familiar with SNMP)
-Gavan
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-30 06:09 AM . Last Modified: 2024-03-08 01:30 AM
I don't think this method is supported but for what your trying to accomplish I'd recommend using either an SSH script that will log-in and run the command to control the outlets or using SNMP to turn the outlets on or off.
-Gavan
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
I've opted to use a nodejs server to that communicates with the pdu whenever my web app makes a request. The nodejs server will send ssh commands to the pdu. I was wondering though if there is any documentation on what ssh commands I can use to communicate with the pdu to login, turn on/off switches?
Thanks for the help,
Albert
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
The easiest way is to log into the PDU via SSH and then issue the ? command, some commands are slightly different for different units and firmwares:
apc>?
System Commands:
---------------------------------------------------------------------------
For command help: command ?
? about alarmcount boot bye cd
clrrst console date delete dir dns
eapol email eventlog exit firewall format
ftp help lang lastrst ledblink logzip
netstat ntp ping portspeed prompt pwd
quit radius reboot resetToDef session smtp
snmp snmptrap snmpv3 system tcpip tcpip6
user userdflt web whoami xferINI xferStatus
Device Commands:
---------------------------------------------------------------------------
alarmList bkLowLoad bkNearOver bkOverLoad bkReading bkPeakCurr
bkRestrictn devLowLoad devNearOver devOverLoad devReading devPeakLoad
devStartDly dispID humAlGen humLow humMin humHyst
humReading humStatus lcd lcdBlink logToFlash olAssignUsr
olCancelCmd olDlyOff olDlyOn olDlyReboot olGroups olName
olOff olOffDelay olOn olOnDelay olRbootTime olReboot
olStatus olUnasgnUsr phLowLoad phNearOver phOverLoad phReading
phPeakCurr phRestrictn prodInfo sensorName tempAlGen tempHigh
tempMax tempHyst tempPeak tempReading tempStatus userAdd
userDelete userList userPasswd
apc>olOff ?
Usage: olOff -- Turn an outlet or group of outlets off.
The id# may be from 1 up to 32 depending on NPS group size.
olOff [
-Gavan
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
Thanks for the response Gavan. Do you know if the rack pdus generate a privateKey that I can use to ssh and authenticate myself into the pdu?
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
Also where can i find this private key once sshed into the rack pdu?
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
The SSH implementation doesn't support key authentication, you'll need to provide a user name and password.
If you want an easier to implement option the I still recommend SNMP, this command will turn of outlet 1 immediately:
(Easier in terms of implementation, you'd need to understand how SNMP works first )
snmpset -v 1 -c public 192.168.0.1 1.3.6.1.4.1.318.1.1.12.3.3.1.1.1 i 2
-Gavan
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
Thanks I will probably use SNMP instead then. Where can I see the commands I can use for SNMP? Can't seem to find any instruction in the documentation for the Rack PDUs. Also would I be able to authenticate into the PDUs with just a username and password because that is all I have access to at the moment?
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-30 06:09 AM . Last Modified: 2024-03-08 01:29 AM
That's not really how SNMP works.
The commands are standard for all SNMP devices the only thing that changes is the target OID and the value set. The list of OIDs associated with the PDUs can be found in the Powernet MIB. (Like I said you'd need to be familiar with SNMP)
-Gavan
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.