-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxiv_array
More file actions
31 lines (25 loc) · 838 Bytes
/
xiv_array
File metadata and controls
31 lines (25 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Allan McAleavy 2017
# Login to Array and gather overall array stats
# Requires a DB called ARRAYS to be created.
user=<username>
pass=<password>
xiv=$1
stime=00
end=23
day=$2
month=$3
year=2018
mkdir ${xiv}_array
POST="http://<INFLUX_DB_SERVER>:8086/write?db=ARRAYS&precision=s"
# Get a list of hosts to parse.
/usr/bin/xcli -m $xiv -s -u $user -p $pass statistics_get start=${year}-${month}-${day}.0:${stime}:00 count=1440 resolution_unit=minute interval=1 > ${xiv}_array/${xiv}_${month}_${day}_${xiv}.csv
grep Time ${xiv}_array/${xiv}_${month}_${day}_${xiv}.csv
if [ $? = 0 ]
then
./graph_xiv_data.pl ${xiv}_array/${xiv}_${month}_${day}_${xiv}.csv Array > ${xiv}_array/array_batch
fi
cd ${xiv}_array
/usr/bin/curl -i -XPOST ${POST} --data-binary @array_batch
cd ..
rm ${xiv}_array/${xiv}_${month}_${day}_${xiv}.csv