Browse code

minor revisions

Gandolf authored on 10/04/2020 05:03:10
Showing 4 changed files
... ...
@@ -9,7 +9,7 @@
9 9
 # database to generate graphic charts for display in the weather station
10 10
 # web page.
11 11
 #
12
-# Copyright 2018 Jeff Owrey
12
+# Copyright 2014 Jeff Owrey
13 13
 #    This program is free software: you can redistribute it and/or modify
14 14
 #    it under the terms of the GNU General Public License as published by
15 15
 #    the Free Software Foundation, either version 3 of the License, or
... ...
@@ -24,21 +24,16 @@
24 24
 #    along with this program.  If not, see http://www.gnu.org/license.
25 25
 #
26 26
 # Revision History
27
-#   * v11 released 24 Jul 2018 by J L Owrey
27
+#   * v10 released 15 Sep 2015 by J L Owrey
28 28
 #
29
-# Example of rrdtool command line executed by this program:
30
-#
31
-#   rrdtool create radmonData.rrd --step 30 DS:CPM:GAUGE:60:U:U
32
-#   DS:SvperHr:GAUGE:60:U:U RRA:LAST:0.5:1:2880 RRA:LAST:0.5:30:35520
33
-#
34
-
35 29
 import os
30
+import time
36 31
 import subprocess
37 32
 
38 33
     ### DEFINE FILE LOCATIONS ###
39 34
 
40 35
 _USER = os.environ['USER']
41
-_RRD_FILE = "/home/%s/database/radmonData.rrd" % _USER  # rrd database file
36
+_RRD_FILE = "/home/%s/database/radmonData.rrd" % _USER  # the file that stores the data
42 37
 _RRD_SIZE_IN_DAYS = 370 # days
43 38
 _1YR_RRA_STEPS_PER_DAY = 96
44 39
 _DATABASE_UPDATE_INTERVAL = 30
... ...
@@ -56,8 +51,7 @@ def createRrdFile():
56 51
      ## Calculate database size
57 52
  
58 53
     heartBeat = 2 * _DATABASE_UPDATE_INTERVAL
59
-    rra1yrNumPDP =  int(round(86400 / (_1YR_RRA_STEPS_PER_DAY * \
60
-                        _DATABASE_UPDATE_INTERVAL)))
54
+    rra1yrNumPDP =  int(round(86400 / (_1YR_RRA_STEPS_PER_DAY * _DATABASE_UPDATE_INTERVAL)))
61 55
     rrd24hrNumRows = int(round(86400 / _DATABASE_UPDATE_INTERVAL))
62 56
     rrd1yearNumRows = _1YR_RRA_STEPS_PER_DAY * _RRD_SIZE_IN_DAYS
63 57
        
... ...
@@ -75,7 +69,8 @@ def createRrdFile():
75 69
         subprocess.check_output(strCmd, stderr=subprocess.STDOUT, \
76 70
                                 shell=True)
77 71
     except subprocess.CalledProcessError, exError:
78
-        print "rrdtool create failed: %s" % (exError.output)
72
+        print "%s rrdtool create failed: %s" % \
73
+                            (getTimeStamp(), exError.output)
79 74
         return False
80 75
     return True
81 76
 ##end def
82 77
similarity index 100%
83 78
rename from bin/startrad
84 79
rename to bin/radstart
85 80
similarity index 56%
86 81
rename from bin/stoprad
87 82
rename to bin/radstop
... ...
@@ -1,10 +1,6 @@
1 1
 #!/bin/bash
2 2
 # Stop the radmon agent process and clean up environment.
3 3
 
4
-# Set path to radmon input data file
5
-RADMON_INPUT_DATA_FILE="/home/$USER/public_html/radmon/dynamic/radmonInputData.dat"
6
-RADMON_OUTPUT_DATA_FILE="/home/$USER/public_html/radmon/dynamic/radmonOutputData.js"
7
-
8 4
 PROCESS_ID="$(ps x | awk '/[r]admonAgent.py/{print $1}')"
9 5
 
10 6
 if [ -n "$PROCESS_ID" ]; then
... ...
@@ -1,7 +1,11 @@
1 1
 <!DOCTYPE html>
2
+<!-- Courtesy ruler for editing this file
3
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
4
+-->
2 5
 <html>
3 6
 <head>
4 7
 <title>DIY Radiation</title>
8
+<meta charset="UTF-8">
5 9
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 10
 <style>
7 11
 body {
... ...
@@ -30,7 +34,7 @@ h4 {
30 34
     width: 50%;
31 35
     padding: 10px;
32 36
     font: bold 20px arial, sans-serif;
33
-    text-align: middle;
37
+    text-align: center;
34 38
     display: table-cell;
35 39
     vertical-align: middle;
36 40
 }