Re: [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 07:46:25
|
<div>Hello,</div><div> </div><div>I have now separated two commands in two shell scripts and having error repeating twice in log. I have installed fcron on my slackware system.</div><div>Use of uninitialized value $val in division (/) at /usr/lib64/monitorix/gensens.pm line 156.</div><div> </div><div><div>* * * * * root sh /root/bin/monitorix_ping1_gensens.sh</div><div>* * * * * root sh /root/bin/monitorix_ping2_gensens.sh</div><div> </div><div> </div></div><div> </div><div>cat /etc/monitorix/conf.d/local.conf</div><div><div># GENSENS graph</div><div># Added on 2025-08-13</div><div># -----------------------------------------------------------------------------</div><div><gensens></div><div> <list></div><div> 0 = temp0</div><div> 1 = temp1</div><div> </list></div><div> <title></div><div> 0 = Pings1</div><div> 1 = Pings2</div><div> </title></div><div> <desc></div><div> temp0 = /tmp/ping1_results.txt</div><div> temp1 = /tmp/ping2_results.txt</div><div> </desc></div><div> <unit></div><div> temp0 = 1</div><div> temp1 = 1</div><div> </unit></div><div> <map></div><div> temp0 = ping to ping1_results</div><div> temp1 = ping to ping2_results</div><div> </map></div><div> <alerts></div><div> </alerts></div><div> rigid = 0, 0, 2</div><div> limit = 100, 100, 100</div><div></gensens></div><div> </div><div> </div></div><div> </div><div>----------------</div><div>To: mon...@li... (mon...@li...);</div><div>Cc: Jordi Sanfeliu (jo...@fi...);</div><div>Subject: [Monitorix-general] [SPAM] want to monitor ping with monitorix;</div><div>14.08.2025, 12:45, "Jordi Sanfeliu via Monitorix-general" <mon...@li...>:</div><blockquote><p>Hello,<br /><br />If you use only a single script to execute these two commands you must<br />keep in mind that the second command will be executed 5 seconds later.<br />That won't scale well if you plan to track more pings. Better use a<br />crontab line for each command.<br /><br />I don't know that is 'fcron', I only have 'cronie' in my Fedora.<br /><br />Regarding the error in the log file, can you, please, paste here the<br />section <gensens> from your configuration file?<br /><br />Regards.<br /><br /><br /><br />On 8/14/25 08:30, wilson rodrigues wrote:</p><blockquote> 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><br /> <<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<br /> a ping statistic?)<br /> <br /> |ping -c 5 -nq 8.8.8.8 | tail -1 | awk '{if ( $4 == "" ) { print<br /> "0/0/0/0" } else { print $4}}' | awk -F / '{print $2 }' > /tmp/<br /> ping1_results.txt ping -c 5 -nq 8.8.4.4 | tail -1 | awk '{if ( $4 ==<br /> "" ) { print "0/0/0/0" } else { print $4}}' | awk -F / '{print $2 }' > /<br /> tmp/ping2_results.txt |<br /> <br /> I have created a shell script with above commands. When the script is<br /> run manually it is working fine. Getting the two graphs in monitorix.<br /> <br /> But when same script is run in fcron only ping2 graph is displaying<br /> correctly. My crontab entry is<br /> <br /> * * * * * root sh /root/bin/monitorix_ping_gensens.sh<br /> <br /> Error in /var/log/monitorix is Use of uninitialized value $val in<br /> division (/) at /usr/lib64/monitorix/gensens.pm line 156.<br /> <br /> What I have tried: Disabling fcron entry and running script manually<br /> works fine. With fcron only ping2 graph is working.<br /> <br /> Sincerely,<br /> Wilson Rodrigues<br /> <br /> <br /> _______________________________________________<br /> Monitorix-general mailing list<br /> <a href="mailto:Mon...@li..." rel="noopener noreferrer">Mon...@li...</a><br /> <a href="https://lists.sourceforge.net/lists/listinfo/monitorix-general" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix-general</a></blockquote><p> </p>--<br />Jordi Sanfeliu<br />FIBRANET Network Services Provider<br /><a href="https://www.fibranet.cat/" rel="noopener noreferrer">https://www.fibranet.cat</a><br /><br /><br /><br />_______________________________________________<br />Monitorix-general mailing list<br /><a href="mailto:Mon...@li..." rel="noopener noreferrer">Mon...@li...</a><br /><a href="https://lists.sourceforge.net/lists/listinfo/monitorix-general" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix-general</a></blockquote><div> </div><div> </div><div>Sincerely,<br />Wilson Rodrigues</div><div> </div> |