Page 1 of 1

Number of Resources

Posted: Tue Feb 20, 2018 2:40 am
by bashar.abed
Hi,

we have Nagios xi version 5.4.10 VM machine

I need to know how to get the current resource configuration on each host (mainly number of CPU cores, total Memory in GB, total Swap in GB, and number of disks)
I need this on any OS platform(Windows, Linux, Solaris, and so).
Also I need to get notified if any changes happen in the number of each resource either increase or decrease.


Thanks

Re: Number of Resources

Posted: Tue Feb 20, 2018 6:03 am
by bashar.abed
Hi,

and also see the below notes and file attached

I did research and find the below command with the needed output
My question is how to put this values on a graph for each host and how to send alert in case this value changed (increase or decrease)

[root@nms libexec]# /usr/local/nagios/libexec/check_snmp_load.pl -H 10.x.x.82 -C jawwal-snmp --v2c -w 80 -c 90 -f
8 CPU, average load 31.0% < 80% : OK | cpu_prct_used=31%;80;90
[root@nms libexec]#

Thanks

Re: Number of Resources

Posted: Tue Feb 20, 2018 10:58 am
by mcapra
I don't know of any existing plugin that can do that for any platform. That sounds more like a task for an inventory management system than a monitoring system.

You could probably write a custom plugin that leverages NCPA, since it's endpoints spit out practically the same information regardless of platform.

Here's an example of the output for the cpu/percent endpoint:
https://www.nagios.org/ncpa/help.php#api-modules-cpu

Code: Select all

{
    "percent": [
        [
            18.8, 
            0.0, 
            1.5, 
            0.0, 
            13.8, 
            0.0, 
            3.2, 
            0.0
        ], 
        "%"
    ]
}
Counting the records in the percent[0] array effectively gives you a count of the available CPU cores, as one example.
bashar.abed wrote:how to send alert in case this value changed (increase or decrease)
A few plugins write the "last returned value" to disk and use that as a reference for future checks. Others use time-series databases to reference historical values.

Re: Number of Resources

Posted: Tue Feb 20, 2018 12:02 pm
by kyang
Thanks for the help @mcapra!

bashar.abed, I currently have not found a plugin that does such functionality either.

Otherwise, mcapra hit this pretty straight on, and a custom plugin would be the best route.

Let me know if you have any other questions.

Re: Number of Resources

Posted: Wed Feb 21, 2018 6:44 am
by bashar.abed
Many thanks kyang

you mean ,you will send me the new plugin to give me the number of resources !

Thanks

Re: Number of Resources

Posted: Wed Feb 21, 2018 10:27 am
by kyang
I'm sorry,

We don't provide any custom solution for this, but we do offer custom development. If you are interested you can contact our sales department for a quote --> [email protected]

Otherwise, you would need to create this custom plugin.

Re: Number of Resources

Posted: Wed Feb 21, 2018 2:23 pm
by bashar.abed
Plaese can you contact sales team to do that

Thanks

Re: Number of Resources

Posted: Wed Feb 21, 2018 3:49 pm
by lmiltchev
You will need to contact sales personally, so that you could lay out in detail your requirements, which will help us determine if this is doable. If it is, we will need to define the scope of the project, objectives, timeline, etc.