(SOLVED) System.Shutdown with delay
-
Hi
We observe a UPS System so we created an event to shutdown a Windows System. I use the Object Tool "&Shutdown system" to shutdown the node with the Windows agent, if the power fails. This works verry well.But how can I delay the shutdown? I´ll shutdown the system with a delay of 5 Minutes and another System with a delay of 8 Minutes.
Any Idea?
Sincerly Lars
-
Hello!
You can define custom action which will call shutdown command with timeout option. For example, to be able to shutdown Windows system with delay, you could:
- define new custom action in agent:
Action = System.ShutdownWithDelay:shutdown.exe /t $1This will add new action called System.ShutdownWithDelay which will accept one argument - delay in seconds.
- If you need to call this action automatically from event processing policy, create actions on server with different delays:
Name: Shutdown_5min
Action: System.ShutdownWithDelay 300Name: Shutdown_8min
Action: System.ShutdownWithDelay 480- If you need to call this action manually via object tools, create new tools of type "action":
Name: Shutdown_5min
Action: System.ShutdownWithDelay 300Name: Shutdown_8min
Action: System.ShutdownWithDelay 480Hope this helps!
Best regards,
Victor -
Wow, fast reply

Step 2 - 3 --> OK and checked.
Step 1 ?
How can I define a new custom action in agent?
I install the agent on my machine. The agent create a directory in c:\NetXMS
Is it possible to use the "Agent Configurations" at Server?Lars
-
@lars.weimar said in (SOLVED) System.Shutdown with delay:
Step 1 ?
How can I define a new custom action in agent?
I install the agent on my machine. The agent create a directory in c:\NetXMSYou should edit agent's configuration file, usually C:\NetXMS\etc\nxagentd.conf and add line mentioned in previous post. You can edit agent's configuration directly from management console by right-clicking node object and selecting "Edit agent configuration" menu. After configuration file change you should restart agent.
Best regards,
Victor -
Sorry, it doesen´t work. I added the line above, but the system doesn´t shut down. If I tried the embedded "System.Shutdown" it works fine. The System shutdown immediately.
I tried the following Setings in nxagentd.conf:
# # NetXMS agent configuration file # Created by agent installer at Wed Jul 15 10:58:04 2009 # #System Shutdown with delay Action = System.ShutdownWithDelay:shutdown.exe /t $1 MasterServers = 192.168.5.250 LogFile = C:\NetXMS\netxms.log FileStore = C:\NetXMS\var SubAgent = winperf.nsm SubAgent = wmi.nsm SubAgent = ups.nsmIn Action Properties:
Clipboard01.jpgIn Event Procesing Policy Editor:
Action "Shutdown_1min"The Log-File of Client after Power Fail:
[20-Jul-2009 08:04:58] Log file opened [20-Jul-2009 08:04:58] Subagent "WINNT.NSM" loaded successfully [20-Jul-2009 08:05:41] Counter set B is empty, collector thread for that set will not start [20-Jul-2009 08:05:41] Counter set C is empty, collector thread for that set will not start [20-Jul-2009 08:05:41] Subagent "winperf.nsm" loaded successfully [20-Jul-2009 08:05:41] Subagent "wmi.nsm" loaded successfully [20-Jul-2009 08:05:41] Subagent "ups.nsm" loaded successfully [20-Jul-2009 08:05:42] Listening on socket 0.0.0.0:4700 [20-Jul-2009 08:05:43] NetXMS Agent started -
Ok, I found the error.
My functional agent config:
#System Shutdown with delay EnableActions = yes Action = System.ShutdownWithDelay:shutdown.exe -s -c "PowerFail" -t $1 Action = System.ShutdownAbort:shutdown.exe -aI added the abort command for Shutdown.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login