CPU and Memory Utilization

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

CPU and Memory Utilization

Post by sneha.irali »

Hi Team,

I would like to know the CPU and Memory Utilization for SUSE NCPA Agent(Basically the formula used for CPU Utilization for SUSE servers).

Suse version : 15.1
Nagios XI : 5.8.3

Regards,
Sneha Irali
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: CPU and Memory Utilization

Post by dchurch »

The CPU percentage calculation is calculated by the Python library psutil. NCPA asks it to sample the CPU usage for half (0.5) a second and average it.

See here for the relevant NCPA source code: https://github.com/NagiosEnterprises/nc ... #L135-L141

How psutils works internally is that it sums the number of "busy" cycles over that 0.5 seconds and divides it by the CPU's capacity. There's more to it, but that's the basics.

You can ask psutil to give you back these values by running this script:

Code: Select all

#!/usr/bin/env python3
import psutil as ps
print(ps.cpu_percent(interval=0.5, percpu=True))
If you're getting back more than 100% CPU utilization, it's because it's probably sampling more than one logical CPU. In which case it sums the percentages. I.e. if you have 2 CPU's at 75% utilization, it may say CPU utilization is at 150%.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
sneha.irali
Posts: 141
Joined: Fri Jan 15, 2021 3:56 am

Re: CPU and Memory Utilization

Post by sneha.irali »

Thanks.. I will check on the cpu utilization. Can you also please help me with the Memory utilization. I have the memory utilization and the swap memory been enabled for monitoring.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: CPU and Memory Utilization

Post by dchurch »

I'm not sure what you mean by "help you out with the memory utilization" -- are you looking to decrease the amount of RAM that Nagios XI uses?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked