[Monitorix-general] [SPAM] want to monitor ping with monitorix
Monitorix is a system monitoring tool
Brought to you by:
mikaku
From: wilson r. <wro...@ya...> - 2025-08-14 06:30:49
|
<div><div><p>I am using this command as per <a href="https://www.monitorix.org/faq.html" rel="noopener noreferrer">https://www.monitorix.org/faq.html</a> (Is there an easy way to integrate a ping statistic?)</p><pre><code>ping -c 5 -nq 8.8.8.8 | tail -1 | awk '{if ( $4 == "" ) { print "0/0/0/0" } else { print $4}}' | awk -F / '{print $2 }' > /tmp/ping1_results.txt ping -c 5 -nq 8.8.4.4 | tail -1 | awk '{if ( $4 == "" ) { print "0/0/0/0" } else { print $4}}' | awk -F / '{print $2 }' > /tmp/ping2_results.txt </code></pre><p>I have created a shell script with above commands. When the script is run manually it is working fine. Getting the two graphs in monitorix.</p><p> </p><p>But when same script is run in fcron only ping2 graph is displaying correctly. My crontab entry is</p><div>* * * * * root sh /root/bin/monitorix_ping_gensens.sh</div><p>Error in /var/log/monitorix is Use of uninitialized value $val in division (/) at /usr/lib64/monitorix/gensens.pm line 156.</p><p>What I have tried: Disabling fcron entry and running script manually works fine. With fcron only ping2 graph is working.</p></div></div><div> </div><div>Sincerely,<br />Wilson Rodrigues</div><div> </div> |