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
CPU and Memory Utilization
Re: CPU and Memory Utilization
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:
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%.
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 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.
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
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.
Re: CPU and Memory Utilization
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.
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.