Changes between Version 2 and Version 3 of OMDqemu

Show
Ignore:
Timestamp:
11/14/11 14:16:33 (8 years ago)
Author:
jonmills (IP: 152.54.3.30)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OMDqemu

    v2 v3  
    1010== The Qemu (KVM) plugin for check_mk_agent == 
    1111 
    12 * Install this on your hosts as /usr/lib/check_mk_agent/plugins/mk_qemu 
    13  
    14 {{{ 
    15 if which virsh >/dev/null; then 
    16         echo '<<<qemu>>>' 
    17         virsh list | grep -v 'State' | grep -v '^--' | grep -v '^$' | while read L 
    18         do 
    19                 ID=$(echo $L | awk '{print $1}') 
    20                 NAME=$(echo $L | awk '{print $2}') 
    21                 STATE=$(echo $L | awk '{print $3}') 
    22                 MEM=$(virsh dominfo $NAME | grep 'Used memory' | awk '{print $3}') 
    23                 let MEM=MEM/1024 
    24                 PID=$(ps aux | grep kvm | grep $NAME | awk '{print $2}') 
    25                 if [ $PID -gt 0 ]; then 
    26                         DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}') 
    27                 else 
    28                         DATA="" 
    29                 fi 
    30                 echo $ID" "$NAME" "$STATE" "$MEM" "$DATA 
    31         done 
    32 fi 
    33 }}} 
    34  
     12 * Check out the source from SVN 
     13  * [https://code.renci.org/gf/project/networkedclouds/scmsvn/nagios/?action=browse&path=%2Fnagios%2Ftrunk%2Fcheck_mk_agent%2Fplugins%2Fqemu%2F mk_qemu] 
     14 * Install this on your hosts as /usr/lib/check_mk_agent/plugins/mk_qemu 
    3515 
    3616== The Check_MK native 'qemu' check ==