https://pve.proxmox.com/mediawiki/api.php?action=feedcontributions&user=Matthias.henze&feedformat=atom
Proxmox VE - User contributions [en]
2024-03-28T19:41:21Z
User contributions
MediaWiki 1.35.11
https://pve.proxmox.com/mediawiki/index.php?title=Nagios_check_mk&diff=2716
Nagios check mk
2011-01-03T20:33:00Z
<p>Matthias.henze: /* Plugin */</p>
<hr />
<div>This is a check for the Nagios check addon "check_mk" (http://mathias-kettner.de/check_mk.html). The idea is that only VM's that are running while doing the inventory are getting monitored. If a VM is added or removed do a:<br />
<br />
check_mk -II tcp proxmoxservername<br />
<br />
The check also collects performance data for %CPU load caused by the VM and % of memory consumption of the VM.<br />
===Client-Check===<br />
/usr/lib/check_mk_agent/plugins/mh_qemu<br />
<pre><br />
#!/bin/sh<br />
<br />
# check_mk check f. LSI Controller<br />
#<br />
# 10/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
# sampel output<br />
# 101 oracle stopped 1024 8.00 0 <br />
# 102 server running 3072 50.00 2634 <br />
# 103 monitoring running 2048 32.00 5139 <br />
# 104 nagios running 1024 32.00 9030<br />
<br />
if which qm >/dev/null ; then<br />
echo '<<<qemu>>>'<br />
qm list | grep -v VMID | while read L<br />
do<br />
PID=$(echo $L | awk -- '{print $6}')<br />
if [ $PID -gt 0 ]; then<br />
DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}')<br />
else<br />
DATA=""<br />
fi<br />
echo $L" "$DATA<br />
done<br />
fi<br />
</pre><br />
<br />
===Plugin===<br />
/omd/versions/0.44/share/check_mk/checks/qemu<br />
<br />
The path asumes the use of OMD (Open source Monitoring Distribution).<br />
<pre><br />
#!/usr/bin/python<br />
# -*- encoding: utf-8; py-indent-offset: 4 -*-<br />
<br />
# check_mk check f. LSI Controlle<br />
#<br />
# 12/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
<br />
# Example output from agent:<br />
#<<<qemu>>><br />
# VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID CUP RAM<br />
# 101 oracle stopped 1024 8.00 0 0 0<br />
# 102 server running 3072 50.00 2634 0 0<br />
# 103 monitoring running 2048 32.00 5139 0 0<br />
# 104 nagios running 1024 32.00 9030 0 0<br />
<br />
<br />
<br />
# inventory<br />
def inventory_qemu(checkname, info):<br />
inventory = []<br />
for line in info:<br />
if line[2] == "running": # only VM's running while inventory are monitored !<br />
vm = line[0]<br />
inventory.append( (vm, None) )<br />
return inventory<br />
<br />
# check<br />
def check_qemu(item, param, info):<br />
for line in info:<br />
perfdata = []<br />
if line[0] == item:<br />
name = line[1]<br />
status = line[2]<br />
ram = line[4]<br />
infotext = "%s (id: %s, name: %s ram: %s MB)" % (status, item, name, ram)<br />
if status == "running":<br />
perfdata.append( ( "CPU%", int(round(float(line[6]))) ) )<br />
perfdata.append( ( "RAM%", int(round(float(line[7]))) ) )<br />
return (0, "OK - status is " + infotext, perfdata)<br />
else:<br />
return (2, "CRITICAL - status is " + infotext, perfdata)<br />
return (3, "UNKNOWN - VM %s not found in agent output" % item) <br />
<br />
# declare the check to Check_MK<br />
check_info['qemu'] = \<br />
(check_qemu, "QEMU VM %s", 1, inventory_qemu)<br />
</pre><br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze
https://pve.proxmox.com/mediawiki/index.php?title=Nagios_check_mk&diff=2715
Nagios check mk
2011-01-03T20:32:18Z
<p>Matthias.henze: /* Plugin */</p>
<hr />
<div>This is a check for the Nagios check addon "check_mk" (http://mathias-kettner.de/check_mk.html). The idea is that only VM's that are running while doing the inventory are getting monitored. If a VM is added or removed do a:<br />
<br />
check_mk -II tcp proxmoxservername<br />
<br />
The check also collects performance data for %CPU load caused by the VM and % of memory consumption of the VM.<br />
===Client-Check===<br />
/usr/lib/check_mk_agent/plugins/mh_qemu<br />
<pre><br />
#!/bin/sh<br />
<br />
# check_mk check f. LSI Controller<br />
#<br />
# 10/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
# sampel output<br />
# 101 oracle stopped 1024 8.00 0 <br />
# 102 server running 3072 50.00 2634 <br />
# 103 monitoring running 2048 32.00 5139 <br />
# 104 nagios running 1024 32.00 9030<br />
<br />
if which qm >/dev/null ; then<br />
echo '<<<qemu>>>'<br />
qm list | grep -v VMID | while read L<br />
do<br />
PID=$(echo $L | awk -- '{print $6}')<br />
if [ $PID -gt 0 ]; then<br />
DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}')<br />
else<br />
DATA=""<br />
fi<br />
echo $L" "$DATA<br />
done<br />
fi<br />
</pre><br />
<br />
===Plugin===<br />
/omd/versions/0.44/share/check_mk/checks/qemu<br />
<br />
The path asumes the usage of OMD (Open source Monitoring Distribution).<br />
<pre><br />
#!/usr/bin/python<br />
# -*- encoding: utf-8; py-indent-offset: 4 -*-<br />
<br />
# check_mk check f. LSI Controlle<br />
#<br />
# 12/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
<br />
# Example output from agent:<br />
#<<<qemu>>><br />
# VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID CUP RAM<br />
# 101 oracle stopped 1024 8.00 0 0 0<br />
# 102 server running 3072 50.00 2634 0 0<br />
# 103 monitoring running 2048 32.00 5139 0 0<br />
# 104 nagios running 1024 32.00 9030 0 0<br />
<br />
<br />
<br />
# inventory<br />
def inventory_qemu(checkname, info):<br />
inventory = []<br />
for line in info:<br />
if line[2] == "running": # only VM's running while inventory are monitored !<br />
vm = line[0]<br />
inventory.append( (vm, None) )<br />
return inventory<br />
<br />
# check<br />
def check_qemu(item, param, info):<br />
for line in info:<br />
perfdata = []<br />
if line[0] == item:<br />
name = line[1]<br />
status = line[2]<br />
ram = line[4]<br />
infotext = "%s (id: %s, name: %s ram: %s MB)" % (status, item, name, ram)<br />
if status == "running":<br />
perfdata.append( ( "CPU%", int(round(float(line[6]))) ) )<br />
perfdata.append( ( "RAM%", int(round(float(line[7]))) ) )<br />
return (0, "OK - status is " + infotext, perfdata)<br />
else:<br />
return (2, "CRITICAL - status is " + infotext, perfdata)<br />
return (3, "UNKNOWN - VM %s not found in agent output" % item) <br />
<br />
# declare the check to Check_MK<br />
check_info['qemu'] = \<br />
(check_qemu, "QEMU VM %s", 1, inventory_qemu)<br />
</pre><br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze
https://pve.proxmox.com/mediawiki/index.php?title=Nagios_check_mk&diff=2714
Nagios check mk
2011-01-03T20:31:50Z
<p>Matthias.henze: /* Plugin */</p>
<hr />
<div>This is a check for the Nagios check addon "check_mk" (http://mathias-kettner.de/check_mk.html). The idea is that only VM's that are running while doing the inventory are getting monitored. If a VM is added or removed do a:<br />
<br />
check_mk -II tcp proxmoxservername<br />
<br />
The check also collects performance data for %CPU load caused by the VM and % of memory consumption of the VM.<br />
===Client-Check===<br />
/usr/lib/check_mk_agent/plugins/mh_qemu<br />
<pre><br />
#!/bin/sh<br />
<br />
# check_mk check f. LSI Controller<br />
#<br />
# 10/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
# sampel output<br />
# 101 oracle stopped 1024 8.00 0 <br />
# 102 server running 3072 50.00 2634 <br />
# 103 monitoring running 2048 32.00 5139 <br />
# 104 nagios running 1024 32.00 9030<br />
<br />
if which qm >/dev/null ; then<br />
echo '<<<qemu>>>'<br />
qm list | grep -v VMID | while read L<br />
do<br />
PID=$(echo $L | awk -- '{print $6}')<br />
if [ $PID -gt 0 ]; then<br />
DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}')<br />
else<br />
DATA=""<br />
fi<br />
echo $L" "$DATA<br />
done<br />
fi<br />
</pre><br />
<br />
===Plugin===<br />
/omd/versions/0.44/share/check_mk/checks/qemu<br />
<br />
The path asumes the usage of OMD (Open source Monitoring Distribution)<br />
<pre><br />
#!/usr/bin/python<br />
# -*- encoding: utf-8; py-indent-offset: 4 -*-<br />
<br />
# check_mk check f. LSI Controlle<br />
#<br />
# 12/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
<br />
# Example output from agent:<br />
#<<<qemu>>><br />
# VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID CUP RAM<br />
# 101 oracle stopped 1024 8.00 0 0 0<br />
# 102 server running 3072 50.00 2634 0 0<br />
# 103 monitoring running 2048 32.00 5139 0 0<br />
# 104 nagios running 1024 32.00 9030 0 0<br />
<br />
<br />
<br />
# inventory<br />
def inventory_qemu(checkname, info):<br />
inventory = []<br />
for line in info:<br />
if line[2] == "running": # only VM's running while inventory are monitored !<br />
vm = line[0]<br />
inventory.append( (vm, None) )<br />
return inventory<br />
<br />
# check<br />
def check_qemu(item, param, info):<br />
for line in info:<br />
perfdata = []<br />
if line[0] == item:<br />
name = line[1]<br />
status = line[2]<br />
ram = line[4]<br />
infotext = "%s (id: %s, name: %s ram: %s MB)" % (status, item, name, ram)<br />
if status == "running":<br />
perfdata.append( ( "CPU%", int(round(float(line[6]))) ) )<br />
perfdata.append( ( "RAM%", int(round(float(line[7]))) ) )<br />
return (0, "OK - status is " + infotext, perfdata)<br />
else:<br />
return (2, "CRITICAL - status is " + infotext, perfdata)<br />
return (3, "UNKNOWN - VM %s not found in agent output" % item) <br />
<br />
# declare the check to Check_MK<br />
check_info['qemu'] = \<br />
(check_qemu, "QEMU VM %s", 1, inventory_qemu)<br />
</pre><br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze
https://pve.proxmox.com/mediawiki/index.php?title=Nagios_check_mk&diff=2713
Nagios check mk
2011-01-03T20:26:49Z
<p>Matthias.henze: Created page with "This is a check for the Nagios check addon "check_mk" (http://mathias-kettner.de/check_mk.html). The idea is that only VM's that are running while doing the inventory are getting…"</p>
<hr />
<div>This is a check for the Nagios check addon "check_mk" (http://mathias-kettner.de/check_mk.html). The idea is that only VM's that are running while doing the inventory are getting monitored. If a VM is added or removed do a:<br />
<br />
check_mk -II tcp proxmoxservername<br />
<br />
The check also collects performance data for %CPU load caused by the VM and % of memory consumption of the VM.<br />
===Client-Check===<br />
/usr/lib/check_mk_agent/plugins/mh_qemu<br />
<pre><br />
#!/bin/sh<br />
<br />
# check_mk check f. LSI Controller<br />
#<br />
# 10/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
# sampel output<br />
# 101 oracle stopped 1024 8.00 0 <br />
# 102 server running 3072 50.00 2634 <br />
# 103 monitoring running 2048 32.00 5139 <br />
# 104 nagios running 1024 32.00 9030<br />
<br />
if which qm >/dev/null ; then<br />
echo '<<<qemu>>>'<br />
qm list | grep -v VMID | while read L<br />
do<br />
PID=$(echo $L | awk -- '{print $6}')<br />
if [ $PID -gt 0 ]; then<br />
DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}')<br />
else<br />
DATA=""<br />
fi<br />
echo $L" "$DATA<br />
done<br />
fi<br />
</pre><br />
<br />
===Plugin===<br />
/omd/versions/0.44/share/check_mk/checks/qemu<br />
<pre><br />
#!/usr/bin/python<br />
# -*- encoding: utf-8; py-indent-offset: 4 -*-<br />
<br />
# check_mk check f. LSI Controlle<br />
#<br />
# 12/2010 Matthias Henze<br />
# Lizenz: GPL v2<br />
<br />
<br />
# Example output from agent:<br />
#<<<qemu>>><br />
# VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID CUP RAM<br />
# 101 oracle stopped 1024 8.00 0 0 0<br />
# 102 server running 3072 50.00 2634 0 0<br />
# 103 monitoring running 2048 32.00 5139 0 0<br />
# 104 nagios running 1024 32.00 9030 0 0<br />
<br />
<br />
<br />
# inventory<br />
def inventory_qemu(checkname, info):<br />
inventory = []<br />
for line in info:<br />
if line[2] == "running": # only VM's running while inventory are monitored !<br />
vm = line[0]<br />
inventory.append( (vm, None) )<br />
return inventory<br />
<br />
# check<br />
def check_qemu(item, param, info):<br />
for line in info:<br />
perfdata = []<br />
if line[0] == item:<br />
name = line[1]<br />
status = line[2]<br />
ram = line[4]<br />
infotext = "%s (id: %s, name: %s ram: %s MB)" % (status, item, name, ram)<br />
if status == "running":<br />
perfdata.append( ( "CPU%", int(round(float(line[6]))) ) )<br />
perfdata.append( ( "RAM%", int(round(float(line[7]))) ) )<br />
return (0, "OK - status is " + infotext, perfdata)<br />
else:<br />
return (2, "CRITICAL - status is " + infotext, perfdata)<br />
return (3, "UNKNOWN - VM %s not found in agent output" % item) <br />
<br />
# declare the check to Check_MK<br />
check_info['qemu'] = \<br />
(check_qemu, "QEMU VM %s", 1, inventory_qemu)<br />
</pre><br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze
https://pve.proxmox.com/mediawiki/index.php?title=USB_Redirector&diff=2711
USB Redirector
2011-01-03T19:29:23Z
<p>Matthias.henze: </p>
<hr />
<div>When trying to use USB and especially USB2 devices in a KVM VM it's most likely that you will fail because qemu/KVM does not support USB pass thru too well. But there is a solution for this problem: The Incentives Pro USB Redirector http://www.incentivespro.com<br />
<br />
The Linux part is free, the Windows part is not. But when you need reliable support for devices connected to the server in a KVM Windows VM it's worth the few bucks.<br />
<br />
The Linux part of the software consists of the following components:<br />
<br />
* a kernel module(tusbd.ko)<br />
* a daemon (usbsrvd)<br />
* a control application (usbsrv)<br />
<br />
Currently (01/2011) there are a few problems with the setup of the kernel module because the official source code of USB Redirector is not up to date and does not work out of the box wicht current kernels - e.g. 2.6.35. You need:<br />
<br />
* the official distribution source: http://incentivespro.com/usb-server-x64.tar.gz<br />
* a more recent version of tusdb.ko source: http://incentivespro.com/tusbd2.6.31.zip<br />
* a patch for the 2.6.31 version: http://www.fnarfbargle.com/tusbd-2.6.36.patch.gz<br />
<br />
===Setup===<br />
<br />
The following asumes that all files are located in /tmp. First resolve the dependencies. You require a basic development environment:<br />
<br />
apt-get install build-essential pve-headers-`uname -r`<br />
<br />
then extract the base distribution:<br />
<br />
cd /tmp<br />
tar xfz usb-server-x64.tar.gz<br />
<br />
unzip the replacement kernel module source:<br />
<br />
unzip tusbd2.6.31.zip<br />
<br />
and copy it to it's destination:<br />
<br />
cd tusbd2.6.3<br />
cp * /tmp/usb-server/modules/src/tusbd/<br />
<br />
now patch the source:<br />
<br />
cd /tmp/usb-server/modules/src/tusbd/<br />
zcat /tmp/tusbd-2.6.36.patch.gz | patch -p1<br />
<br />
the patch should apply with out any rejects. The last step is to patch the installer. Go to the main folder:<br />
<br />
cd /tmp/usb-server<br />
<br />
and edit the intaller by:<br />
<br />
sed -i 's/KERNELDIR=\/usr\/src\/linux/KERNELDIR=\/usr\/src\/linux-headers-`uname -r`/' installer.sh <br />
<br />
now you are ready to do the install by:<br />
<br />
./installer.sh<br />
<br />
It should show no errors and report success. Now you are ready to share connected USB devices. First list the detected devices:<br />
<br />
usbsrv -l<br />
<br />
this displays some thing like this:<br />
<br />
<pre><br />
================= USB SERVER OPERATION SUCCESSFUL ===============<br />
List of USB devices:<br />
<br />
1: SE USB Device ServerEngines / Composite USB Device<br />
Vid: 0000 Pid: 0000 Port: 6-1<br />
Status: plugged<br />
<br />
2: Wireless Desktop MLK / Composite USB Device<br />
Vid: 046a Pid: 0101 Port: 8-2<br />
Status: plugged<br />
<br />
3: FreeAgent Go Seagate / USB Mass Storage Device<br />
Vid: 0bc2 Pid: 2101 Port: 1-3.3<br />
Status: plugged<br />
<br />
4: FreeAgent Go Seagate / USB Mass Storage Device<br />
Vid: 0bc2 Pid: 2101 Port: 1-3.4<br />
Status: plugged<br />
<br />
5: CANON DR-5010C CANON <br />
Vid: 04a9 Pid: 1606 Port: 2-5<br />
Status: not plugged, shared<br />
<br />
===================== ======================= ===================<br />
</pre><br />
<br />
If you want to share the Canon Scanner do:<br />
<br />
usbsrv -share 5<br />
<br />
where 5 is the ID of the device showen in the listing. Completely redundant is:<br />
<br />
usbsrv -share -vid 04a9 -pid 1606 -usbport 2-5<br />
<br />
Now you are ready to connect the Windows client. For a how to see:<br />
<br />
http://www.incentivespro.com/usb-redirector.html<br />
<br />
===Links===<br />
<br />
http://forum.proxmox.com/threads/4719-BSOD-with-USB-device-passthrough-on-Windows-XP-virtual-machine<br />
<br />
http://www.incentivespro.com/forum/viewtopic.php?t=295&highlight=64bit<br />
<br />
http://www.incentivespro.com/forum/viewtopic.php?t=512<br />
<br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze
https://pve.proxmox.com/mediawiki/index.php?title=USB_Redirector&diff=2710
USB Redirector
2011-01-03T18:21:13Z
<p>Matthias.henze: Created page with "http://forum.proxmox.com/threads/4719-BSOD-with-USB-device-passthrough-on-Windows-XP-virtual-machine http://www.incentivespro.com/forum/viewtopic.php?t=295&highlight=64bit http…"</p>
<hr />
<div>http://forum.proxmox.com/threads/4719-BSOD-with-USB-device-passthrough-on-Windows-XP-virtual-machine<br />
<br />
http://www.incentivespro.com/forum/viewtopic.php?t=295&highlight=64bit<br />
<br />
http://www.incentivespro.com/forum/viewtopic.php?t=512<br />
<br />
<br />
[[Category: HOWTO]]</div>
Matthias.henze