Add scripts to create myops-getqueryview:
[myops.git] / web / query / _attachments / files / input.cfg
diff --git a/web/query/_attachments/files/input.cfg b/web/query/_attachments/files/input.cfg
new file mode 100644 (file)
index 0000000..f8dcd00
--- /dev/null
@@ -0,0 +1,40 @@
+type : echo "node-status-v3"
+date : date --rfc-3339='seconds' | tr ' ' 'T'
+ts : date +%s
+hostname : hostname
+boot_state : if [ -d /vservers ] ; then echo 'BOOT' ; else echo 'DEBUG' ; fi
+ip_internal : ifconfig eth0 | grep "inet addr:" | sed -e 's/addr://' | awk '{print $2}'
+diskspace_root : python -c 'import sys, os; f="/"; v=os.statvfs(f); sys.stdout.write("%s %.3f %.3f\\n" % (f, v[4]/float(v[2]), v[6]/float(v[5])));' 2>/dev/null  
+diskspace_vservers : python -c 'import sys, os; f="/vservers/"; v=os.statvfs(f); sys.stdout.write("%s %.3f %.3f\\n" % (f, v[4]/float(v[2]), v[6]/float(v[5])));' 2>/dev/null  
+free_disk_root : python -c 'import sys, os; f="/"; v=os.statvfs(f); sys.stdout.write("%.3f\\n" % (v[4]/float(v[2]) ));' 2>/dev/null  
+free_inodes_root : python -c 'import sys, os; f="/"; v=os.statvfs(f); sys.stdout.write("%.3f\\n" % (v[6]/float(v[5]) ));' 2>/dev/null  
+free_disk_vservers : python -c 'import sys, os; f="/vservers/"; v=os.statvfs(f); sys.stdout.write("%.3f\\n" % (v[4]/float(v[2]) ));' 2>/dev/null  
+free_inodes_vservers : python -c 'import sys, os; f="/vservers/"; v=os.statvfs(f); sys.stdout.write("%.3f\\n" % (v[6]/float(v[5]) ));' 2>/dev/null  
+f := echo "/var/local/fprobe/"`ls -rt /var/local/fprobe | tail -1`
+fs_status : grep "planetlab-vservers.*ro," /proc/mounts ; touch /var/log/monitor 2>&1 ; if [ -d /vservers/ ] ; then touch /vservers/monitor.log 2>&1  ; fi 
+install_date : python -c "import os,time,stat; print time.strftime('%s %Y-%m-%dT%H:%M:%S',time.localtime(os.stat('/usr/boot/cacert.pem')[stat.ST_CTIME]))"
+iptables_status : iptables -t mangle -nL | awk '$1~/^[A-Z]+$/ {modules[$1]=1;}END{for (k in modules) {if (k) printf "%s ",k;}}'
+kernel_version : uname -r -v
+netflow : perl -e '@s=stat($ARGV[0]);$hours=(time()-$s[9])/3600;(($hours < 4) && print "Ok") || print("Bad");' $f
+netflow_live : touch /var/local/fprobe/.myopscheck;vserver pl_netflow exec bash -c 'if [ -f "/pf/.myopscheck" ]; then echo "OK"; else echo "KO"; fi;';rm -f /var/local/fprobe/.myopscheck
+nm_status : ps ax | grep nodemanager.py | grep -v grep | tail -1
+plc_config : wc -l /etc/planetlab/plc_config | awk '{if ($1<5) {print "KO";} else {print "OK";}}'
+princeton_comon_dir : ls -d /vservers/princeton_comon
+princeton_comon_procs : vps ax | grep `grep princeton_comon /etc/passwd | awk -F : '{if ( $3 > 500 ) { print $3}}'` | grep -v grep | wc -l
+princeton_comon_running : ls -d /proc/virtual/`grep princeton_comon /etc/passwd | awk -F : '{if ( $3 > 500 ) { print $3}}'`
+redundant_procs : sleep 10 && ps xo args | sort | uniq -c | sort -n | grep -v " [1-5] " | grep -vE "bash|flock|sshd|collect|grep" | tail -1 | tr ':' ';' 
+rpmprocess_count : pgrep "rpm|yum" | wc -l
+running_slices : vps ax | awk '{print $3}' | grep -vE 'ALL_PROC|MAIN|TTY|\\?' | sort | uniq
+uptime : cat /proc/uptime | awk '{print $1}'
+uptime_idle : cat /proc/uptime | awk '{print $2}'
+boot_server : cat /mnt/cdrom/bootme/BOOTSERVER
+bootcd_version : cat /mnt/cdrom/bootme/ID || cat /usr/bootme/ID
+rpm_versions :  sleep 10; if [ -f /home/pl_monitor/timeout3.sh ] ; then /home/pl_monitor/timeout3.sh -t 60 rpm -q -a ; else rpm -q -a ; fi
+traceroute_from_host : traceroute -n 128.112.139.91 | tr '\\n' '|'
+traceroute_to_host : curl -s --insecure 'https://128.112.139.113/monitor/traceroute'
+hardware_system : /home/pl_monitor/lshw -short -class system | grep -E "^\\W+system" | sed -e 's/.*system *//g'
+hardware_processor : /home/pl_monitor/lshw -short -class processor | grep -E "processor.*(Intel|AMD|Pentium)" | sed -e 's/.*processor *//g'
+hardware_memory : /home/pl_monitor/lshw -short -class memory | grep -E "memory.*[[:digit:]].*System Memory" | sed -e 's/.*memory *//g'
+hardware_disk : /home/pl_monitor/lshw -short -class disk | grep -E "sd.*disk" | sed -e 's/.*disk *//g' | tr '\\n' ';'
+hardware_network : /home/pl_monitor/lshw -short -class network | grep -E "eth[[:digit:]].*network" | sed -e 's/.*network *//g' | tr '\\n' ';'
+hardware_pcu : /home/pl_monitor/lshw -short -class system,generic | grep -E "Lights.*Controller|DRAC" | sed -e 's/.*system *//g;s/.*generic *//g'