Browse Source

Scripts and simple texts

master
samuel 3 years ago
parent
commit
dd5d596aa4
  1. 0
      awk
  2. 2
      awk1
  3. 48
      script
  4. 3
      script1.sh
  5. 20
      ups

2
awk1

@ -0,0 +1,2 @@
pwrstat -status | awk '{ print "12345," $0; }' > ups

48
script

@ -0,0 +1,48 @@
#Should do something like
cat myfile |while read file
do
echo $file |awk '/State/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Utility Voltage/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Battery Capacity/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Remaining Runtime/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Load/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Line Interaction/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Test Result/' myfile >> > awk
done
cat myfile |while read file
do
echo $file |awk '/Last Power Event/' myfile >> > awk
done

3
script1.sh

@ -0,0 +1,3 @@
pwrstat -status | grep -E 'State|Power Supply by|Utility Voltage|Output Voltage|Battery Capacity|Remaining Runtime|Load|Line Interaction|Test Result|Last Power Event' > ups

20
ups

@ -0,0 +1,20 @@
12345,
12345,The UPS information shows as following:
12345,
12345, Properties:
12345, Model Name................... Value2200E
12345, Rating Voltage............... 230 V
12345, Rating Power................. 1320 Watt(2200 VA)
12345,
12345, Current UPS status:
12345, State........................ Normal
12345, Power Supply by.............. Utility Power
12345, Utility Voltage.............. 235 V
12345, Output Voltage............... 235 V
12345, Battery Capacity............. 100 %
12345, Remaining Runtime............ 100 min.
12345, Load......................... 0 Watt(0 %)
12345, Line Interaction............. None
12345, Test Result.................. Unknown
12345, Last Power Event............. Blackout at 2019/07/23 10:14:07 for 72 min.
12345,
Loading…
Cancel
Save