NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
177 stars 95 forks source link

FR: Need Performance Graph for Services/Processes #924

Closed vtracnagios closed 1 year ago

vtracnagios commented 1 year ago

A client want to have a performance graph for checking "services" and "processes".

Since checking for "services" only return "OK" for "Running" and "Failed) for "Stopped". There isn't any "values" returned from the service check for graphing.

It would be nice to have "graph", which will let the client know if or when the NCPA agent stopped.

ericloyd commented 1 year ago

Are you talking about active checks performed by the Nagios server or passive checks generated by the remote host that are sent to the Nagios server through NRDP or other methods?

vtracnagios commented 1 year ago

The client is talking about active check data coming from NCPA to Nagios XI not displaying performing graph.

Example: /usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'ncpaToken' -M 'services' -q 'service=ncpa_listener' OK: ncpa_listener is running

As you can see from above, there is no value(s) returned from the check, so no graphs were generated.

ericloyd commented 1 year ago

This check returns a boolean value of "running" or "stopped" with no other values, that I'm aware of. What possible performance data could it return?

vtracnagios commented 1 year ago

Which is why I opened this FR. Make it return some number like "1" or "0" or "3" (unknown) .... so that graph can be generated.

ericloyd commented 1 year ago

This is what availability reports are for. You should educate your customer on how to use them properly. A world of reporting possibilities will be opened before their very eyes!

image

ericloyd commented 1 year ago

Also, why run a service check looking for the listener status? We typically run a check looking for the NCPA server version number, then tie that as a dependency for all the active NCPA based service checks. If that fails to respond, then the others don't trigger, plus you get to track the version number over time so you know when it's time to upgrade.

Lastly, isn't it "ncpalistener" not "ncpa_listener"?

ccztux commented 1 year ago

To get peformance data you can do this:

OK example:

08:37:18 ✓ LAB-CL01 root@cl01 ~ # /usr/lib64/meg/plugins/check_ncpa.py -H localhost -t mytoken -M services -q 'service=gssproxy' --performance
OK: gssproxy is running | 'status'=0;1;2;;

UNKNOWN example:

08:37:20 ✓ LAB-CL01 root@cl01 ~ # /usr/lib64/meg/plugins/check_ncpa.py -H localhost -t mytoken -M services -q 'service=gssproxyS' --performance
UNKNOWN: No services found for service names: gssproxyS | 'status'=3;1;2;;

Snippet from the help output of check_ncpa.py:

  -p, --performance     Print performance data even when there is none. Will
                        print data matching the return code of this script
ccztux commented 1 year ago

Also, why run a service check looking for the listener status? We typically run a check looking for the NCPA server version number, then tie that as a dependency for all the active NCPA based service checks. If that fails to respond, then the others don't trigger, plus you get to track the version number over time so you know when it's time to upgrade.

Lastly, isn't it "ncpalistener" not "ncpa_listener"?

It is ncpa_listener

08:41:07 ✓ LAB-CL01 root@cl01 ~ # /usr/lib64/meg/plugins/check_ncpa.py -H localhost -t mytoken -M services -q 'service=ncpa_listener' --performance
OK: ncpa_listener is running | 'status'=0;1;2;;
vtracnagios commented 1 year ago

Thanks guys!! :-) I think this issue can be close as there is an option "--performance", which can be used for this.

vtracnagios commented 1 year ago

I have just learned that there is an option "--performance", which can be used to generate performance graph for "services".

ericloyd commented 1 year ago

Ooops. Windows sees the service name as "ncpalistener" while Linux sees it with the dash.

image

ccztux commented 1 year ago

Ooops. Windows sees the service name as "ncpalistener" while Linux sees it with the dash.

image

You are absolutely right. I forgot about the inconsistent naming.