Artemis ActiveMQ Plugins for Nagios?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jsimon
Posts: 339
Joined: Wed Aug 23, 2023 11:27 am

Re: Artemis ActiveMQ Plugins for Nagios?

Post by jsimon »

@amoss24,

I think the issue is actually the way args are being passed. "args=" should not be needed, only the -q and then the full arg list wrapped in quotes. I would suggest opening up the web interface for NCPA:

Code: Select all

http://yourXIaddress:5693
You should be able to build and test your command from there. I don't believe you need to escape commas from this string, just the quotes. Let us know how this goes!
amoss24
Posts: 31
Joined: Thu Dec 17, 2020 1:19 pm

Re: Artemis ActiveMQ Plugins for Nagios?

Post by amoss24 »

I think I am pretty close here, just seems like something is getting lost in translation when I attempt to take the NCPA example and put it in to my XI config. If I log in to the NCPA GUI and go to the API tab, I'm able to drill down just fine to plugins > check_jmx and supply my arguments. Here's the output I get:

Code: Select all

Active Check Example
Running the following active check from the command line:

./check_ncpa.py -H <our_NCPA_hostname> -t '<your token>' -M 'plugins/check_jmx' -q 'args=-U service:jmx:rmi:///jndi/rmi://<our_IP_address>:1099/jmxrmi -O org.apache.activemq.artemis:broker=\"<our_artemis_instance>\",component=addresses,address=\"event.hub.load.error.test\" -A AddressSize -vvvv -w 300 -c 400'
Would result in the following output:

JMX CRITICAL - AddressSize=96838 | AddressSize=96838
However, if I copy and paste everything after -q over to the CCM, the plugin is attempted to be executed but it appears the arguments are not made over because the output I get back is

Code: Select all

JMX UNKNOWN Required options not specified Usage: check_jmx -help
In the NCPA GUI, I can also split up the args line by line and get the same output there. However, copying it over to the CCM results in a little bit of a different output

Code: Select all

-q 'args=-U service:jmx:rmi:///jndi/rmi://<our_IP_address>:1099/jmxrmi,args=-O org.apache.activemq.artemis:broker=\"<our_artemis_instance>\",component=addresses,address=\"event.hub.load.error.test\",args=-A AddressSize,args=-vvvv,args=-w 300,args=-c 400'
Results in:

Code: Select all

JMX CRITICAL - No such attribute: AddressSize connecting to org.apache.activemq.artemis:broker="<our_artemis_instance" by URL service:jmx:rmi:///jndi/rmi://<our_ip_address>:1099/jmxrmijavax.management.AttributeNotFoundException: No such attribute: AddressSize
jsimon
Posts: 339
Joined: Wed Aug 23, 2023 11:27 am

Re: Artemis ActiveMQ Plugins for Nagios?

Post by jsimon »

I think the next thing to try is changing the "-q" to a -"a" for passing your arguments. "-q" is for URL parameter arguments, but since you're passing command line args to a plugin, it looks to me like you should be using "-a". I'm not sure this accounts for the difference in what you're seeing between XI vs NCPA, but it should be a step in the right direction.
amoss24
Posts: 31
Joined: Thu Dec 17, 2020 1:19 pm

Re: Artemis ActiveMQ Plugins for Nagios?

Post by amoss24 »

To me it does not look like my input is getting parsed out of the config correctly. If I take what the NCPA GUI suggests to me and copy it in to the CCM like so:

Code: Select all

 .... -q 'args=-U service:jmx:rmi:///jndi/rmi://<our_IP_address>:1099/jmxrmi -O org.apache.activemq.artemis:broker=\"<name_of_our_broker>\",component=addresses,address=\"event.hub.load.error.test\" -A AddressSize -vvvv -w 300 -c 400'
It looks like everything is not being passed to the plugin, here's the NCPA logs:

Code: Select all

2024-06-2817:03:01,447geventwebsocket.handlerINFO::ffff:<nagios_XI_server_IP>--[2024-06-2817:03:01]"GET/api/plugins/check_jmx/?token=********&check=1&args=-U+service:jmx:rmi:///jndi/rmi://<our_IP_address>:1099/jmxrmi+-O+org.apache.activemq.artemis:broker=\"<name_of_our_broker>\"&component=addresses&address=\"event.hub.load.error.test\"+-A+AddressSize+-vvvv+-w+300+-c+400HTTP/1.1"2006070.083672
In the example above, the return message is coming from the plugin

Code: Select all

JMX UNKNOWN Required options not specified Usage: check_jmx -help

Running with -a instead results in this error returned from Java/Artemis AMQ:
NCPAError.png
To me, it seems like NCPA handles this fine as I can input the all the arguments in the GUI and go to the appropriate URL and retrieve the data. The issue seems to be in XI with the CCM or running it from XI with check_ncpa.py
You do not have the required permissions to view the files attached to this post.
jsimon
Posts: 339
Joined: Wed Aug 23, 2023 11:27 am

Re: Artemis ActiveMQ Plugins for Nagios?

Post by jsimon »

I think the next most productive step here would probably be to open a case on our AnswerHub so that a dedicated support analyst can take a look at the details of your setup and provide more tailored help.

https://answerhub.nagios.com/support/s/
amoss24
Posts: 31
Joined: Thu Dec 17, 2020 1:19 pm

Re: Artemis ActiveMQ Plugins for Nagios?

Post by amoss24 »

Thanks @jsimon,

I'll look at it a little bit more then see if we decide to open a support case.
Post Reply