NetXMS Support Forum

English Support => General Support => Topic started by: tivanni on September 02, 2013, 05:48:53 PM

Title: How to use nxaction from command line
Post by: tivanni on September 02, 2013, 05:48:53 PM
Hi,

i need to run a netxms action from a script, so i want to use nxaction from command line. I have Netxms installed on Debian.
My action is saved as "test_action", when executed it send a mail.
if i run from command line "nxaction netxms test_action" (where netxms is the name of the node of the Netxms Server) , I got "Error 500: Internal Error".
How can i run this action from command line?
Thank you :)
Title: Re: How to use nxaction from command line
Post by: Victor Kirhenshtein on September 02, 2013, 08:06:38 PM
Hi!

nxaction is a tool intended for connecting to agent and executing action on agent (defined in nxagentd.conf using Action parameter). For executing server action simpliest way is to use nxevent for sending custom event and executing action you need in event processing policy as usual.

Best regards,
Victor
Title: Re: How to use nxaction from command line
Post by: tivanni on September 04, 2013, 01:12:25 PM
Thank You!

nxevent is avaible from command line?

I have installed version 1.2.7, and I cannot find in /usr/local/bin the nxevent utility. The following is the content of the directory:
netxmsd      nxagentd     nxapush      nxencpasswd  nxscript     nxsnmpwalk
nxaction     nxap         nxdbmgr      nxget        nxsnmpget    nxupload
nxadm        nxappget     nxdevcfg     nxmibc       nxsnmpset

If i search on filesystem, I found i found only the source code of nxevent.

Thank you again.
Title: Re: How to use nxaction from command line
Post by: Victor Kirhenshtein on September 04, 2013, 03:51:28 PM
Hi!

If you install NetXMS from sources, you should add --with-client option to configure.

Best regards,
Victor
Title: Re: How to use nxaction from command line
Post by: tivanni on September 09, 2013, 06:38:21 PM
Yes, I've installed netxms from source.

When I've installed netxms, i didn't use the --with-client option...Have I to re-execute the installation process with the --with-client option?
Are riskes in this operation?

Thank you
Title: Re: How to use nxaction from command line
Post by: Victor Kirhenshtein on September 10, 2013, 09:26:10 AM
Hi!

Yes, you have to run configure and make again. There should be no risks, it will just build few additional binaries.

Best regards,
Victor
Title: Re: How to use nxaction from command line
Post by: tivanni on September 19, 2013, 12:34:44 PM
Thank you!
It works fine!
nxevent is a very useful utility!!!!