Command works in Terminal but not Run Check Command GUI??

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

Hey gents!

Another what i hope is a dumb one. I know this may not be the way something was intended to be used, old way, etc. (mostly because we cant get the actual configwizard to work correctly for this plugin so we manually just imported the command from our Core installation and got it all setup) but I'm just trying to get this one command to work on one system (as it works on numerous other systems so I know it works) and just looking for input on why this might happen.

So I have this command and as you can see it comes back working in the NagiosXI terminal:

Code: Select all

[root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <server_name_here> -P 5693 -M 'plugins/check_openmanage.exe' -t '<token_string_here>' -T 90 -a '--check voltage=0,batteries=0,esmhealth=0 --blacklist pdisk_cert=all/ctrl_fw=all/ctrl_driver=all'
OK - System: 'PowerEdge RXX0', SN: '12345678', 384 GB ram (12 dimms), 1 logical drives, 8 physical drives
However in the GUI, it just shows nothing in the Run Check Command window:

Code: Select all

[[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_ncpa.py -H <sever_name_here> -P 5693 -M 'plugins/check_openmanage.exe' -t '<token_string_here>' -T 90 -a '--check voltage=0,batteries=0,esmhealth=0 --blacklist pdisk_cert=all/ctrl_fw=all/ctrl_driver=all'
Any idea why that would happen? As you can see I did specify the timeout to 90 to ensure it runs but I cant figure out why this wont return a response from the GUI.
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Re: Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

I have another command that is doing the same thing (but on a different server)

Code: Select all

./check_http -t 50 -H <hostaddress_here> -u <url_here> -s <string_info_here>
It does take 31seconds to render the OK via Terminal but in the GUI it just returns the command and no information.

Does the GUI have its own separate timeout that is exclusive from the commands I enter that would cause this response?
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Re: Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

Does anyone know if the GUI has its own built-in timeout that supersedes the timeouts that are placed in the command line? That is the only thing I can think of happening with these 2 servers is that the responses are a little slower for these 2 checks than others.

Also, is there a log with the commands that are executed from the GUI to see if that showcases any errors since when I launch the commands via terminal they work fine?

**EDIT** - So I just went into the Core Config and changed the host timeout from 30 to 110 and service timeouts from 60 to 120...made no difference on either of my checks
Marilian
Posts: 6
Joined: Sun Jun 25, 2023 11:31 pm

Re: Command works in Terminal but not Run Check Command GUI??

Post by Marilian »

lveitch wrote: Mon Apr 01, 2024 2:28 pm I have another command that is doing the same thing (but on a different server)

Code: Select all

./check_http -t 50 -H <hostaddress_here> -u <url_here> -s <string_info_here>
It does take 31seconds to render the OK via Terminal but in the GUI it just returns the command and no information. run 3

Does the GUI have its own separate timeout that is exclusive from the commands I enter that would cause this response?
Response times for these two checks are slightly slower than average, and that's the only thing I can think of as affecting these two servers.
User avatar
lgute
Posts: 123
Joined: Mon Apr 06, 2020 2:49 pm

Re: Command works in Terminal but not Run Check Command GUI??

Post by lgute »

Hi @lveitch, thanks for reaching out.

Can you give us a little more information? What version of XI are you running and what OS/version?

You can manually run the check in XI to see how long it takes to run.
  1. navigate to Configure > Core Config Manager > Services.
  2. Then click on the appropriate Config Name (Service).
  3. At the bottom of the screen, click "Run Check Command" and then click the "Run Check Command" in the popup/modal.
Please let us know if you have any other questions or concerns.

-Laura
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Re: Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

@igute
Can you give us a little more information? What version of XI are you running and what OS/version?
Running latest R1.1.1 on Ubuntu 22
You can manually run the check in XI to see how long it takes to run.
Unfortunately thats not the case for these 2 checks. When I run them in Terminal....they come back with good responses (and yes these 2 checks are slower than my other ones). HOWEVER, when I run them in the Run Check Command in the GUI...nothing happens. It spins and then just shows me the command I input with no response of any kind.

I will say that these checks work as they work in Terminal and they work on other systems so the command is good; just dont know why the GUI wont return a response
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Re: Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

I was able to circumvent one check (my URL one) by having it examine for a text string in the URL that was a few layers less. Weird that it wont report the full URL (which took 31-34 seconds to respond) but reports a URL a few layers shorter (10 seconds or so for response) even though I have the timer for hosts to be 120 and services to be 110 in Core Config which should be ample time (also this specific command didn't have a timeout in the arguments)

The other command on the other machine however is not playing so nice and I cant really shorten it any as I even removed the arguments from the string to just give me an output without complicating anything and it still takes almost 30 seconds.

Code: Select all

root@nagiosxi:/usr/local/nagios/libexec# time ./check_ncpa.py -H <server_name_here> -P 5693 -M 'plugins/<plugin_name_here>' -t '<token_string_here>'
OK - System: '<system_information_here>

real    0m29.911s
user    0m0.053s
sys     0m0.012s
Thats why I really think there is some sort of GUI related timeout that prevents it from showcasing the outputs or finishing the commands that are outside of the timeouts. Yes I have rebooted the entire server many times but no changes either :-(

Code: Select all

host_check_timeout=120
service_check_timeout=110
lveitch
Posts: 18
Joined: Fri Mar 22, 2024 10:02 am

Re: Command works in Terminal but not Run Check Command GUI??

Post by lveitch »

So I also went in to ensure my nagios.cfg file had both the passive and plugin timeouts to something like 110 so I am just stuck. I am going to just try the service again and go through everything and see if anything yields. I wonder if it will work and the output just isnt showing...

**EDIT**Well that is very interesting...

Even though the Run Check Command comes back with nothing in it...if I add the service check and force it to do an immediate check...it works!

So there must be some sort of coding issue with Nagios in that it wont render an output on the screen in a certain time.
Post Reply