VB Scripts or BAT files

Started by maxknight, January 30, 2008, 10:26:04 AM

Previous topic - Next topic

maxknight

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?

Victor Kirhenshtein

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

maxknight

Victor,

Thanks for the updates. Love this product  :)

Anth0ny

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.
:)

Victor Kirhenshtein

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