Scripts and simple texts
This commit is contained in:
parent
db23d16476
commit
dd5d596aa4
5 changed files with 73 additions and 0 deletions
0
awk
Normal file
0
awk
Normal file
2
awk1
Normal file
2
awk1
Normal file
|
@ -0,0 +1,2 @@
|
|||
pwrstat -status | awk '{ print "12345," $0; }' > ups
|
||||
|
48
script
Executable file
48
script
Executable file
|
@ -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
Executable file
3
script1.sh
Executable file
|
@ -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
Normal file
20
ups
Normal file
|
@ -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…
Reference in a new issue