NetXMS Support Forum

English Support => General Support => Topic started by: maxknight on January 30, 2008, 10:26:04 AM

Title: VB Scripts or BAT files
Post by: maxknight on January 30, 2008, 10:26:04 AM
Hi,

Is there any way by which we can call VB Scripts or BAT files on remote server after a poll or when a threshould condition is met?
Title: Re: VB Scripts or BAT files
Post by: Victor Kirhenshtein on January 30, 2008, 12:57:03 PM
Hello!

Yes, you can, but you will need NetXMS agent running on a remote server. Configuration will consist from several steps:

1. On remote server, define an action in agent's configuration file (nxagentd.conf):

Action = MyAction:my_command.exe


or


ActionShellExec = MyAction:my_script.cmd


where MyAction is the name of your defined action - it will be used later in configuration.


2. In a threshold configuration, select event you wish to be sent when threshold is violated.

3. Define action on server - go to Control Panel -> Actions and create new action of type "Execute action on remote agent". In the remote host field, enter IP address of remote server or use %a macro - it will be expanded to the address of a host which generates the event. In an action field, enter name of the action defined on agent - MyAction in our example.

4. Add a rule to event processing policy - in events column add event you have selected on step 2, and in action column add action defined in step 3. Save the policy.

That's all. Now when threshold will be violated, your configured action will be executed on remote host.

Best regards,
Victor
Title: Re: VB Scripts or BAT files
Post by: maxknight on January 30, 2008, 01:29:03 PM
Victor,

Thanks for the updates. Love this product  :)
Title: Re: VB Scripts or BAT files
Post by: Anth0ny on October 14, 2008, 03:45:42 PM
Victor, can you explain a second option too, "Execute command on management server"? How it works and what's a different from "Execute action on remote agent"?

Please.
:)
Title: Re: VB Scripts or BAT files
Post by: Victor Kirhenshtein on October 14, 2008, 04:45:11 PM
Execute action on management server means that given command will be executed on a machine where NetXMS server runs. In this case, parent process for a command will be netxmsd itself.

Execute action on remote agent means that given command will be executed on a (remote) machine where NetXMS agent runs. In this case, parent process for a command will be nxagentd.

Best regards,
Victor