CPU load of a particular process, service or command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

CPU load of a particular process, service or command

Post by tecnalb »

Hello,

Is there a way in XI to monitor the load/CPU % of a particular process, command or service? For example,

Lets say I have four GVMs running on a KVM server. I want to monitor and graph the CPU or load on the host, of each of those virtual machines services. I know how to check for the service running, but I'm more interested in the ability to actually graph this information over time.

Here is the output of top. I'm interested in plotting, over time, PID 27742 as it uses considerable CPU.

top - 18:38:58 up 33 days, 8:57, 1 user, load average: 1.34, 2.16, 4.90
Tasks: 380 total, 1 running, 379 sleeping, 0 stopped, 0 zombie
Cpu(s): 10.6%us, 1.9%sy, 0.0%ni, 87.1%id, 0.4%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 65971604k total, 57574008k used, 8397596k free, 316732k buffers
Swap: 68206584k total, 0k used, 68206584k free, 43707216k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27742 qemu 20 0 5032m 4.1g 4972 S 84.9 6.5 26383:12 qemu-kvm
8194 qemu 20 0 1567m 1.0g 4480 S 6.6 1.6 5659:38 qemu-kvm
8043 qemu 20 0 1475m 1.0g 4432 S 6.3 1.6 3853:51 qemu-kvm
9995 qemu 20 0 4770m 3.9g 4480 S 4.6 6.3 3270:01 qemu-kvm

Below is the output of ps.

qemu 27742 90.5 6.4 5153500 4261560 ? Sl 2012 26381:17 /usr/libexec/qemu-kvm -S -M rhel6.3.0 -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -name tri-khp -uuid 60e5532c-35a4-46bc-2153-5bcf650b5b42 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/tri-khp.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/boot.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/dev/lv_block/lv_data,if=none,id=drive-virtio-disk1,format=raw,cache=none,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=29 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=xx:xx:xx:xx:xx bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7

So is there a plugin or some formatting to an already/exist function I could use to possibly do this?

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: CPU load of a particular process, service or command

Post by scottwilkerson »

Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart