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-07-01 01:07 AM . Last Modified: 2024-03-06 02:07 AM
Hi,
I'm trying to test some VMware shutdown scripts. The APC engineer I spoke to on the phone, said that to test the scripts its best to associate the .bat script to the Communication: Established event. I've kept the filenames and folder names simple: c:\apc\shutdownvmware-test.bat and, all thats in the bat at the moment is:
set FOLDER=c:\apc
set LOG=%FOLDER%\shutdown_log.txt
echo %DATE%,%TIME%,Starting APC Shutdown >> "%LOG"
So all it should do is generate a log file. If I run it manually it does just that.
If I stop/start the service (pcns.exe), then in the apc Event Log, I see "Communication Established". But watching the process list with Process Explorer, I never see a cmd.exe spawn off from pcns.exe, and the log isn't generated.
The pcns service is running as SYSTEM. The folder is writeable by SYSTEM.
Where have I gone wrong ??
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-07-01 01:08 AM . Last Modified: 2024-03-06 02:02 AM
Also whats not clear is what '0' means in the "Run the command..." and "The command file needs.." boxes
It could mean, that the command doesn't run, or it could mean those don't apply if they're zero.
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-07-01 01:07 AM . Last Modified: 2024-03-06 02:06 AM
I would recommend looking at the kbase below as you need to enter specific syntax in the command file so PCNS knows what to do with it. Please let us know if this helps.
http://nam-en.apc.com/app/answers/detail/a_id/2441/kw/PCNS%20command%20file
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-07-01 01:07 AM . Last Modified: 2024-03-06 02:02 AM
Just to add: Yes the tick box for 'run a command file' is ticked, and I've tried setting values in the "Run The Command..." and "The command file needs this much time..." boxes.
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-07-01 01:07 AM . Last Modified: 2024-03-06 02:02 AM
Hi Chris,
Ok, so having read that again, whats not clear, is if those @START commands go into the PCNS GUI webpage, or, if those are lines within a .BAT script.
They include rem statements, which suggests that they go into the .BAT, however, you can't @start an 'echo' command.
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-07-01 01:08 AM . Last Modified: 2024-03-06 02:02 AM
Also whats not clear is what '0' means in the "Run the command..." and "The command file needs.." boxes
It could mean, that the command doesn't run, or it could mean those don't apply if they're zero.
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.