Create RRD
This commit is contained in:
parent
4991bfa107
commit
9bf4e00e16
2
add
2
add
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
. settings
|
. settings
|
||||||
|
|
||||||
if [[ $REQUEST_METHOD != POST ]]
|
if [[ $REQUEST_METHOD != POST ]] || [ ! -w "$rrdfile" ]
|
||||||
then
|
then
|
||||||
cat <<-EOHead
|
cat <<-EOHead
|
||||||
Content-type: text/plain
|
Content-type: text/plain
|
||||||
|
|||||||
47
add.html
47
add.html
@ -80,6 +80,53 @@ Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
|||||||
<td style="background:black; color:white">Add data</td>
|
<td style="background:black; color:white">Add data</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
EOHTML
|
||||||
|
if ! [ -w "$rrdfile" ]
|
||||||
|
then
|
||||||
|
rrdtool create ingress.rrd -s $((60*60)) \
|
||||||
|
DS:AP:GAUGE:$((2*24*60*60)):0:NaN \
|
||||||
|
DS:Explorer:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Seer:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:XM:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Hacker:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Builder:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Connector:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Mind_Controller:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:MU:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Longest_Link:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Largest_Field:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Recharger:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Liberator:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Pioneer:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Purifier:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Neutralized:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Links_Destroyed:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Fields_Destroyed:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Walked:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Guardian:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Link_Maintained:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Link_Length_x_Days:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Field_Held:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
DS:Field_x_Days:GAUGE:$((48*60*60)):0:NaN \
|
||||||
|
RRA:HWPREDICT:8760:8e-1:8e-1:$((24)) \
|
||||||
|
RRA:AVERAGE:99e-2:1:$((24*15)) \
|
||||||
|
RRA:MAX:99e-2:1:$((24*15)) \
|
||||||
|
RRA:AVERAGE:99e-2:4:$((24*180)) \
|
||||||
|
RRA:MAX:99e-2:4:$((24*180)) \
|
||||||
|
RRA:AVERAGE:99e-2:24:$(((4*365)+1)) \
|
||||||
|
RRA:MAX:99e-2:24:$(((4*365)+1)) \
|
||||||
|
RRA:AVERAGE:99e-2:$((24*30)):$(((32*365)+8)) \
|
||||||
|
RRA:MAX:99e-2:$((24*30)):$(((32*365)+8)) \
|
||||||
|
|| {
|
||||||
|
cat <<-EOHTML
|
||||||
|
<h1 style="color:red">Cannot create $rrdfile</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOHTML
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
cat <<-EOHTML
|
||||||
<form method="post" action="add">
|
<form method="post" action="add">
|
||||||
<ul>
|
<ul>
|
||||||
EOHTML
|
EOHTML
|
||||||
|
|||||||
11
index
11
index
@ -17,6 +17,17 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
. settings
|
. settings
|
||||||
|
if [ ! -w "$rrdfile" ]
|
||||||
|
then
|
||||||
|
cat <<-EOHead
|
||||||
|
Content-type: text/plain
|
||||||
|
Last-Modified: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
|
Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
|
refresh: 0,url=/cgi/$webuser/add.html
|
||||||
|
|
||||||
|
EOHead
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$QUERY_STRING" ]
|
if [ -n "$QUERY_STRING" ]
|
||||||
then
|
then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user