NetXMS Support Forum

English Support => General Support => Topic started by: sushizang on June 11, 2009, 08:18:51 AM

Title: How can I restart remote process automatically?
Post by: sushizang on June 11, 2009, 08:18:51 AM
I want to restart my remote process(linux) when that process goes down, using NetXMS console.

How can I do?

Thanks.
Regards.
Title: Re: How can I restart remote process automatically?
Post by: Victor Kirhenshtein on June 11, 2009, 12:07:25 PM
You should define action on agent, and than define tool to execute that action in console via Control Panel -> Object Tools.

To define custom action, add to agent's config:

Action = ActionName:command

Best regards,
Victor
Title: Re: How can I restart remote process automatically?
Post by: sushizang on June 11, 2009, 06:51:10 PM
1. Add action to agent's config & restart agent
Action = Test:ls > /ls.txt

2. Define action on console's object tools.
name: Test
description: ls
command: ls > /ls.txt
access: everyone

And then?

Before,  I have define the action on "control panel -> Actions".

And add it to event processing policy editor.

And add that event on "Data collection -> threshold".

But, not work.

What is the difference between action and object tools on control panel?

Sorry, but I can not find the details of define action on user manual.


Thanks.
Regards.
Title: Re: How can I restart remote process automatically?
Post by: Victor Kirhenshtein on June 13, 2009, 02:03:14 PM
Hello!

Looks like some of the system functions has misleading names. We have:

1. Actions on server (configurable under Control Panel -> Actions): it's an actions server can perform as a result of event processing. These actions can only be used in event processing policy.

2. Actions on agent (configurable in agent's configuration file via Action or ActionShellExec parameters): it's a predefined commands agent can execute upon request.

3. Object tools (configurable via Control Panel -> Object Tools): something which can be executed by operator on currently selected node in console. Object tools can be:

a) Command - local command execution (executed on same machine where netXMS console is running);
b) Action - predefined action execution on agent
c) SNMP table - get data from SNMP
d) Agent table - get data from agent
e) Open URL - open given URL in embedded browser



If you wish to run something on remote machine via agent, you should:

1. Define action on agent (using Action or ActionShellExec - if you wish to use shell functionality like output redirection, you should use ActionShellExec).

2. Depending on your need: if you wish to run something automatically, as a reaction to event, then:
2a. Define server action (Control Panel -> Actions) of type "execute action on remote agent", enter name of agent's action into "Action" field;
2b. Add your server action to event processing policy.

If you wish to be able to run something on remote machine manually, via "Tools" menu:
2a. Create new object tool (Control Panel -> Object Tools) of type "Action", enter name of agent's action into "Action" field.

Hope this helps!

Best regards,
Victor
Title: Re: How can I restart remote process automatically?
Post by: rnr on November 19, 2009, 06:35:52 PM
Another question. I can run shell command on agent. So how can i get the result of command and show on Windows console.
Ex: i defined in nxagentd.conf
ActionShellExec = FWStatus:iptables -L

How can i get the result of this command?
Title: Re: How can I restart remote process automatically?
Post by: Victor Kirhenshtein on November 23, 2009, 12:51:13 PM
Currently it is not possible. Most likely such feature will be added in one of the next versions.

Best regards,
Victor