[svn r20] fixed steps in rrstool, moved shutdown to xen trunk svn.20

Fri, 19 Mar 2010 18:10:52 +0100

author
mbayer
date
Fri, 19 Mar 2010 18:10:52 +0100
branch
trunk
changeset 17
ef30d3abf610
parent 16
9dbe77e40565
child 18
d54571dc6d31

[svn r20] fixed steps in rrstool, moved shutdown to xen

README file | annotate | diff | comparison | revisions
config.py file | annotate | diff | comparison | revisions
shutdown.sh file | annotate | diff | comparison | revisions
shutdown_xen.sh file | annotate | diff | comparison | revisions
tools.py file | annotate | diff | comparison | revisions
update_graph.sh file | annotate | diff | comparison | revisions
--- a/README	Tue Feb 16 15:17:31 2010 +0100
+++ b/README	Fri Mar 19 18:10:52 2010 +0100
@@ -20,4 +20,5 @@
     rrdtool
     python2.5
     python2.5-rrdtool
-    python-serial
\ No newline at end of file
+    python-serial
+    
--- a/config.py	Tue Feb 16 15:17:31 2010 +0100
+++ b/config.py	Fri Mar 19 18:10:52 2010 +0100
@@ -18,7 +18,7 @@
 HTTP_AUTH_SETTINGS	= "admin"	# password for any changes/ups commands (empty password not allowed)
 
 # SERIAL COMMUNICATIONS TO THE UPS
-SERIAL_DEV	= "/dev/ttyUSB0"
+SERIAL_DEV	= "/dev/ttyS0"
 
 
 #-------------------------------------------------------------
--- a/shutdown.sh	Tue Feb 16 15:17:31 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-# check if we got parameter "now", then secure shutdown the system
-if [ "$1" = "now" ]; then
-    echo "UPS System Shutdown initiated...."
-    # give another 5 seconds for mail being processed properly
-    sleep 5
-    # shut down any running virtual xen machines...
-    # get the list
-    XEN=`xm list | grep -v -E \(Name\|Domain\) | cut -d " " -f 1`
-    for VM in $XEN; do
-	echo "XEN DOMAIN SHUTDOWN: $VM"
-	xm shutdown $VM
-	sleep 1
-    done
-
-    # give a few secs to safely shutdown the vms
-    sleep 20
-
-    # shutdown and halt the host system
-    shutdown -h now
-else
-    echo "NO SHUTDOWN, GIVE CORRECT PARAMETER"
-fi
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shutdown_xen.sh	Fri Mar 19 18:10:52 2010 +0100
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# check if we got parameter "now", then secure shutdown the system
+if [ "$1" = "now" ]; then
+    echo "UPS System Shutdown initiated...."
+    # give another 5 seconds for mail being processed properly
+    sleep 5
+    # shut down any running virtual xen machines...
+    # get the list
+    XEN=`xm list | grep -v -E \(Name\|Domain\) | cut -d " " -f 1`
+    for VM in $XEN; do
+	echo "XEN DOMAIN SHUTDOWN: $VM"
+	xm shutdown $VM
+	sleep 1
+    done
+
+    # give a few secs to safely shutdown the vms
+    sleep 20
+
+    # shutdown and halt the host system
+    shutdown -h now
+else
+    echo "NO SHUTDOWN, GIVE CORRECT PARAMETER"
+fi
\ No newline at end of file
--- a/tools.py	Tue Feb 16 15:17:31 2010 +0100
+++ b/tools.py	Fri Mar 19 18:10:52 2010 +0100
@@ -15,6 +15,7 @@
         try:
             r = os.system("rrdtool create "+filename+" \
                     --start=1000277700 \
+                    --step=10
                     DS:Vin:GAUGE:10:U:U \
                     DS:Pin:GAUGE:10:U:U \
                     DS:Fin:GAUGE:10:U:U \
--- a/update_graph.sh	Tue Feb 16 15:17:31 2010 +0100
+++ b/update_graph.sh	Fri Mar 19 18:10:52 2010 +0100
@@ -19,31 +19,42 @@
 
 # 24h graph
 rrdtool graph http/img/ups-24h.png -s $D1 -e $NOW \
-    --x-grid MINUTE:30:HOUR:1:HOUR:1:2:"%H:%M" \
+    --x-grid MINUTE:10:HOUR:1:HOUR:2:0:"%H:%M" \
     --units=si \
     --watermark "neo-soft.org" \
+    --title "Status - last 24 hours" \
     --width 1000 \
     --height 500 \
-    DEF:dVin=$RRD:Vin:MAX \
-    DEF:dPin=$RRD:Pin:MAX \
-    DEF:dVout=$RRD:Vout:MAX \
-    DEF:dPout=$RRD:Pout:MAX \
-    DEF:dTbat=$RRD:Tbat:MAX \
-    DEF:dFin=$RRD:Fin:MAX \
-    DEF:dLoad=$RRD:Load:MAX \
+    --slope-mode \
+    DEF:dVin=$RRD:Vin:AVERAGE \
+    DEF:dPin=$RRD:Pin:AVERAGE \
+    DEF:dVout=$RRD:Vout:AVERAGE \
+    DEF:dPout=$RRD:Pout:AVERAGE \
+    DEF:dTbat=$RRD:Tbat:AVERAGE \
+    DEF:dFin=$RRD:Fin:AVERAGE \
+    DEF:dLoad=$RRD:Load:AVERAGE \
     CDEF:dPloss=dPin,dPout,- \
     AREA:dPin#EEEE00:"Input Power" \
-    LINE1:dPin#000000:"Input Power" \
+    GPRINT:dPin:MIN:"Min\: %5.1lf W" \
+    GPRINT:dPin:MAX:"Max\: %5.1lf W" \
+    GPRINT:dPin:AVERAGE:"Avg\: %5.1lf W\n" \
+    LINE1:dPin#000000:"" \
     AREA:dPout#EEBB00:"Output Power" \
-    LINE1:dVin#0000EE:"Vin" \
-    LINE1:dTbat#666600:"Tbat"\
-    LINE1:dFin#00AA00:"Fin" \
+    GPRINT:dPout:MIN:"Min\: %5.1lf W" \
+    GPRINT:dPout:MAX:"Max\: %5.1lf W" \
+    GPRINT:dPout:AVERAGE:"Avg\: %5.1lf W\n" \
+    LINE1:dVin#0000EE:"Input Voltage" \
+    GPRINT:dVin:MIN:"%3.0lf" \
+    GPRINT:dVin:MAX:"-  %3.0lf V" \
+    LINE1:dFin#00AA00:"Frequency" \
+    GPRINT:dFin:MIN:"%2.1lf" \
+    GPRINT:dFin:MAX:"-  %2.1lf Hz" \
     LINE1:dLoad#FF6666:"Load" \
-    "GPRINT:dPin:MIN:PIN Min\: %5.2lf W" \
-    "GPRINT:dPin:MAX:PIN Max\: %5.2lf W" \
-    "GPRINT:dPout:MIN:POUT Min\: %5.2lf W" \
-    "GPRINT:dPout:MAX:POUT Max\: %5.2lf W" \
-    COMMENT:"Status - last 24 hours" >/dev/null
+    GPRINT:dLoad:MIN:"%2.1lf" \
+    GPRINT:dLoad:MAX:"-  %3.1lf %%" \
+    LINE1:dTbat#666600:"Battery"\
+    GPRINT:dTbat:MIN:"%2.0lf" \
+    GPRINT:dTbat:MAX:"-  %2.0lf °C" >/dev/null
 
 #exit
 
@@ -63,16 +74,18 @@
     DEF:dLoad=$RRD:Load:MAX \
     CDEF:dPloss=dPin,dPout,- \
     AREA:dPin#EEEE00:"Input Power" \
-    LINE1:dPin#000000:"Input Power" \
+    GPRINT:dPin:MIN:"Min\: %5.2lf W" \
+    GPRINT:dPin:MAX:"Max\: %5.2lf W" \
+    GPRINT:dPin:AVERAGE:"Avg\: %5.2lf W\n" \
+    LINE1:dPin#000000:"" \
     AREA:dPout#EEBB00:"Output Power" \
+    GPRINT:dPout:MIN:"Min\: %5.2lf W" \
+    GPRINT:dPout:MAX:"Max\: %5.2lf W" \
+    GPRINT:dPout:AVERAGE:"Avg\: %5.2lf W\n" \
     LINE1:dVin#0000EE:"Vin" \
     LINE1:dTbat#666600:"Tbat"\
     LINE1:dFin#00AA00:"Fin" \
     LINE1:dLoad#FF6666:"Load" \
-    "GPRINT:dPin:MIN:PIN Min\: %5.2lf W" \
-    "GPRINT:dPin:MAX:PIN Max\: %5.2lf W" \
-    "GPRINT:dPout:MIN:POUT Min\: %5.2lf W" \
-    "GPRINT:dPout:MAX:POUT Max\: %5.2lf W" \
     COMMENT:"Status - last 30 days" >/dev/null
 
 

mercurial