Nagios XI: Statistics data retrieval

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Nagios XI: Statistics data retrieval

Post by rajasegar »

2015-10-21_07-31-02.png
Where can I retrieve the information from the pic above?
1) Current scheduled events count
2) Total hosts and breakdown by status
3) Total services and breakdown by status

Thanks.
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI: Statistics data retrieval

Post by lmiltchev »

Run the following command from the CLI:

Code: Select all

/usr/local/nagios/bin/nagiostats
Is this what you were looking for?
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Nagios XI: Statistics data retrieval

Post by rajasegar »

lmiltchev wrote:Run the following command from the CLI:

Code: Select all

/usr/local/nagios/bin/nagiostats
Is this what you were looking for?
Thanks most of the info is there. However the scheduled events info is definately wrong

Code: Select all

CURRENT STATUS DATA
------------------------------------------------------
Status File:                            /var/nagiosramdisk/status.dat
Status File Age:                        0d 0h 0m 5s
Status File Version:                    4.1.1

Program Running Time:                   0d 15h 18m 41s
Nagios PID:                             12868

Total Services:                         9827
Services Checked:                       9826
Services Scheduled:                     9778
Services Actively Checked:              9782
Services Passively Checked:             45
Total Service State Change:             0.000 / 51.320 / 0.133 %
Active Service Latency:                 0.000 / 9.932 / 0.518 sec
Active Service Execution Time:          0.000 / 60.009 / 0.871 sec
Active Service State Change:            0.000 / 51.320 / 0.104 %
Active Services Last 1/5/15/60 min:     1060 / 5870 / 8285 / 8642
Passive Service Latency:                0.010 / 1.120 / 0.460 sec
Passive Service State Change:           0.000 / 12.370 / 6.366 %
Passive Services Last 1/5/15/60 min:    0 / 0 / 0 / 0
Services Ok/Warn/Unk/Crit:              9422 / 210 / 45 / 150
Services Flapping:                      17
Services In Downtime:                   0

Total Hosts:                            1264
Hosts Checked:                          1264
Hosts Scheduled:                        1264
Hosts Actively Checked:                 1264
Host Passively Checked:                 0
Total Host State Change:                0.000 / 16.250 / 0.022 %
Active Host Latency:                    0.000 / 1.130 / 0.507 sec
Active Host Execution Time:             0.002 / 10.004 / 0.204 sec
Active Host State Change:               0.000 / 16.250 / 0.022 %
Active Hosts Last 1/5/15/60 min:        308 / 1253 / 1264 / 1264
Passive Host Latency:                   0.000 / 0.000 / 0.000 sec
Passive Host State Change:              0.000 / 0.000 / 0.000 %
Passive Hosts Last 1/5/15/60 min:       0 / 0 / 0 / 0
Hosts Up/Down/Unreach:                  1261 / 3 / 0
Hosts Flapping:                         0
Hosts In Downtime:                      0

Active Host Checks Last 1/5/15 min:     1 / 12 / 23
   Scheduled:                           0 / 0 / 0
   On-demand:                           1 / 12 / 23
   Parallel:                            0 / 0 / 0
   Serial:                              0 / 0 / 0
   Cached:                              1 / 12 / 23
Passive Host Checks Last 1/5/15 min:    0 / 0 / 0
Active Service Checks Last 1/5/15 min:  0 / 0 / 0
   Scheduled:                           0 / 0 / 0
   On-demand:                           0 / 0 / 0
   Cached:                              0 / 0 / 0
Passive Service Checks Last 1/5/15 min: 0 / 0 / 0

External Commands Last 1/5/15 min:      0 / 0 / 0

We are using active checks only and have 1264 hosts in this instance and it is checked every 5 minutes.
How come the Active Host Checks Last 1 / 5 / 15min is showing 1 / 12 / 23?

The same for Active Service Checks, it is showing 0 / 0 / 0 which is wrong.
I suspect it is due to mod_gearman.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagios XI: Statistics data retrieval

Post by BanditBBS »

I just checked mine, the numbers for active checks for hosts and services are all wrong as well, they are not whats displayed in the GUI.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Nagios XI: Statistics data retrieval

Post by rajasegar »

BanditBBS wrote:I just checked mine, the numbers for active checks for hosts and services are all wrong as well, they are not whats displayed in the GUI.
On my other instance not using mod_gearman, it is showing the correct results.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI: Statistics data retrieval

Post by lmiltchev »

@BanditBBS
You are also using gearman, correct? Can you verify if these numbers are correct on a system that is NOT using mod gearman?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagios XI: Statistics data retrieval

Post by BanditBBS »

lmiltchev wrote:@BanditBBS
You are also using gearman, correct? Can you verify if these numbers are correct on a system that is NOT using mod gearman?
I am not Ludmil. The numbers are crazy wrong though. In nagios they show as 2100/5000/15000 (approx) for active service checks. Running that script I see 2100/5000/45000
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI: Statistics data retrieval

Post by lmiltchev »

Are you looking at:

Code: Select all

Active Services Last 1/5/15/60 min:     x / x / x / x
or at:

Code: Select all

Active Service Checks Last 1/5/15 min:  x / x / x
   Scheduled:                           x / x / x
You need to be looking at the top line. My numbers match but I am not sure if there is an issue with very large environments...

Try the following - right click somewhere within the "Monitoring Engine Check Statistics" window->This Frame->Reload Frame and almost right-away run:

Code: Select all

/usr/local/nagios/bin/nagiostats
Compare the numbers for "Active Service Checks" (1,5, & 15 min).

You can also log in Nagios Core:

Code: Select all

http://x.x.x.x/nagios/
click on the "Performance Info" menu and review the numbers there.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagios XI: Statistics data retrieval

Post by BanditBBS »

XI:
Capture.PNG
CLI:

Code: Select all

Active Host Checks Last 1/5/15 min:     261 / 1383 / 4117
   Scheduled:                           248 / 1315 / 3896
   On-demand:                           13 / 68 / 221
   Parallel:                            248 / 1315 / 3896
   Serial:                              0 / 0 / 0
   Cached:                              13 / 68 / 221
Passive Host Checks Last 1/5/15 min:    0 / 0 / 0
Active Service Checks Last 1/5/15 min:  2433 / 12021 / 35627
   Scheduled:                           2433 / 12021 / 35627
   On-demand:                           0 / 0 / 0
   Cached:                              0 / 0 / 0
Core:

Code: Select all

Type	Last 1 Min	Last 5 Min	Last 15 Min
Active Scheduled Host Checks	222	1308	3909
Active On-Demand Host Checks	14	68	219
Parallel Host Checks	222	1308	3909
Serial Host Checks	0	0	0
Cached Host Checks	14	68	219
Passive Host Checks	0	0	0
Active Scheduled Service Checks	2469	12038	35649
Active On-Demand Service Checks	0	0	0
Cached Service Checks	0	0	0
Passive Service Checks	0	0	0
External Commands	0	0	0
You do not have the required permissions to view the files attached to this post.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI: Statistics data retrieval

Post by lmiltchev »

The "CLI" and "Core" numbers are pretty close:

CLI
Active Service Checks Last 1/5/15 min: 2433 / 12021 / 35627
Core
Active Scheduled Service Checks 2469 12038 35649

These are the "scheduled" active service checks for the last 1/5/15 min (in the future). This is different than what you see under the "Monitoring Engine Check Statistics" window ("Active Service Checks"). To see these numbers, run:

Code: Select all

/usr/local/nagios/bin/nagiostats | grep "Active Services Last 1/5/15/60 min:"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked