NetXMS Support Forum

English Support => General Support => Topic started by: SpotTheCat on July 23, 2021, 03:49:04 PM

Title: Scheduling node restarts via script or right clicking on the node?
Post by: SpotTheCat on July 23, 2021, 03:49:04 PM
Hi,

We have a lot of Windows nodes that we manage. We have a custom DCI that shows when the servers a waiting for a reboot. Ideally we'd like to be able to right click on the server and add a scheduled task to reboot the servers. However I can't find any functions in nxsl and I don't think it's possible to write a script for nxshell to run the at command. So I'm wondering if I've missed something in the documentation that would allow us to do this?

We have a library script that reboots a node and we can call this from the scheduled tasks. This works fine but adding a lot of nodes manually takes a lot of time and inevitably ends up with the odd typo.

Kind regards

Spot
Title: Re: Scheduling node restarts via script or right clicking on the node?
Post by: Filipp Sudanov on July 26, 2021, 10:20:54 AM
Scheduling tasks is currently not possible from NXSL. But should be possible using nxshell, because nxshell allows to do anything what desktop client can. 

So the sequence can be
Object tool that runs NXSL script
NXSL script creates an event
EPP has rule for that event, that runs "execute command on management server" action
the action runs nxshell command

I can prepare the actual nxshell script example a bit later.
Title: Re: Scheduling node restarts via script or right clicking on the node?
Post by: Victor Kirhenshtein on August 05, 2021, 02:08:24 PM
Another option is to generate special event from NXSL script, and in event processing policy execute restart action for that event.

Best regards,
Victor