У меня есть следующий скрипт bash, который я пытаюсь реализовать, но он ужасно терпит неудачу, кто-нибудь может мне помочь с каким-нибудь советом ...
#!/bin/bash
FILE='/var/www/router.rrd'
OUTPUT='/var/www/router.png'
RRDTOOL='rrdtool graph'
$RRDTOOL $OUTPUT \
-t "192.168.10.1" -v "Time in ms" \
--start="now-1d" \
--end="now" \
--height="120" \
--width="440" \
"DEF:ping_time=$FILE:ping:AVERAGE" \
"CDEF:shading2=ping_time,0.98,*" "AREA:shading2#F90000:router" \
"GPRINT:ping_time:LAST:Last\: %5.2lf ms" \
"GPRINT:ping_time:MIN:Min\: %5.2lf ms" \
"GPRINT:ping_time:MAX:Max\: %5.2lf ms" \
"GPRINT:ping_time:AVERAGE:Avg\: %5.2lf ms" >/dev/null
Сообщения об ошибках похожи на следующие
<code>
hostname:/# sh -v /var/www/router.sh
FILE='/var/www/router.rrd'
OUTPUT='/var/www/router.png'
RRDTOOL='rrdtool graph'
HOST='hello'
: command not foundre_retea/ping/router.sh: line 6:
"$RRDTOOL" $OUTPUT \
: command not foundre_retea/ping/router.sh: line 7: rrdtool graph
-t "192.168.10.1" -v "Time in ms" \
/var/www/router.sh: line 8: -t: command not found
--start="now-1d" \
/var/www/router.sh: line 9: --start=now-1d: command not found
--end="now" \
/var/www/router.sh: line 10: --end=now: command not found
--height="120" \
/var/www/router.sh: line 11: --height=120: command not found
--width="440" \
/var/www/router.sh: line 12: --width=440: command not found
"DEF:ping_time=$FILE:ping:AVERAGE" \
/var/www/router.sh: line 13: DEF:ping_time=/var/www/router.:ping:AVERAGE: No such file or directory
"CDEF:shading2=ping_time,0.98,*" "AREA:shading2#F90000:router" \
/var/www/monitorizare_retea/ping/100.100.100.6_graph.sh: line 14: CDEF:shading2=ping_time,0.98,*: command not found
"GPRINT:ping_time:LAST:Last\: %5.2lf ms" \
.... and so on