How to use nxaction from command line

Started by tivanni, September 02, 2013, 05:48:53 PM

Previous topic - Next topic

tivanni

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

Victor Kirhenshtein

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

tivanni

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.

Victor Kirhenshtein

Hi!

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

Best regards,
Victor

tivanni

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

Victor Kirhenshtein

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

tivanni

Thank you!
It works fine!
nxevent is a very useful utility!!!!