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 08:48:39
|
<div>Hello,</div><div> </div><div>The two files which I shared were created by cron. I will troubleshoot the cron issue and check monitorix configuration once more.</div><div> </div><div>Thanks for your understanding and support.</div><div> </div><div>----------------</div><div>To: wilson rodrigues (wro...@ya...), mon...@li... (mon...@li...);</div><div>Subject: [Monitorix-general] [SPAM] want to monitor ping with monitorix;</div><div>14.08.2025, 14:11, "Jordi Sanfeliu" <jo...@fi...>:</div><blockquote><p>Hello,<br /><br />If running the scripts manually the graphs are created successfully then<br />the problem is in your crond daemon, not in Monitorix.<br /><br />Don't show me the contents of these two files after executing the<br />scripts manually since we already know that it works this way. Please,<br />remove these files and let your crond create them, and then read their<br />contents and see if are correct.<br /><br />Besides this, I see some errors in your log file that makes me think<br />that your configuration file is either outdated or you removed a lot of<br />lines from it, which is not recommended.<br /><br />Please, read the FAQ <<a href="https://www.monitorix.org/faq.html#Q107" rel="noopener noreferrer">https://www.monitorix.org/faq.html#Q107</a>> to know<br />how to configure Monitorix properly.<br /><br />Regards.<br /><br /><br /><br />On 8/14/25 10:30, wilson rodrigues wrote:</p><blockquote> Hello,<br /> I misunderstood the purpose of running in parallel two cron jobs. Please<br /> find attached the monitorix log<br /> cat /tmp/ping1_results.txt<br /> 1.724<br /> cat /tmp/ping2_results.txt<br /> 1.380<br /> Please note running the scripts manually displays the graphs properly.<br /> ----------------<br /> To: wilson rodrigues (<a href="mailto:wro...@ya..." rel="noopener noreferrer">wro...@ya...</a>), monitorix-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a> (<a href="mailto:mon...@li..." rel="noopener noreferrer">mon...@li...</a>);<br /> Subject: [Monitorix-general] [SPAM] want to monitor ping with monitorix;<br /> 14.08.2025, 13:21, "Jordi Sanfeliu" <<a href="mailto:jo...@fi..." rel="noopener noreferrer">jo...@fi...</a>>:<br /> <br /> Hello,<br /> <br /> The recommendation to use two commands is to have them run in parallel<br /> instead of serial. Hence you can have multiple cron jobs running at the<br /> same time. This suggestion didn't have any relationship with the errors<br /> in your log file.<br /> <br /> What are the contents of the files '/tmp/ping1_results.txt' and<br /> '/tmp/ping2_results.txt'?<br /> <br /> Also, please, paste you Monitorix log file.<br /> <br /> Regards.<br /> <br /> <br /> On 8/14/25 09:46, wilson rodrigues wrote:<br /> <br /> Hello,<br /> I have now separated two commands in two shell scripts and<br /> having error<br /> repeating twice in log. I have installed fcron on my slackware<br /> system.<br /> Use of uninitialized value $val in division (/) at /usr/lib64/<br /> monitorix/<br /> gensens.pm line 156.<br /> * * * * * root sh /root/bin/monitorix_ping1_gensens.sh<br /> * * * * * root sh /root/bin/monitorix_ping2_gensens.sh<br /> cat /etc/monitorix/conf.d/local.conf<br /> # GENSENS graph<br /> # Added on 2025-08-13<br /> #<br /> -----------------------------------------------------------------------------<br /> <gensens><br /> <list><br /> 0 = temp0<br /> 1 = temp1<br /> </list><br /> <title><br /> 0 = Pings1<br /> 1 = Pings2<br /> </title><br /> <desc><br /> temp0 = /tmp/ping1_results.txt<br /> temp1 = /tmp/ping2_results.txt<br /> </desc><br /> <unit><br /> temp0 = 1<br /> temp1 = 1<br /> </unit><br /> <map><br /> temp0 = ping to ping1_results<br /> temp1 = ping to ping2_results<br /> </map><br /> <alerts><br /> </alerts><br /> rigid = 0, 0, 2<br /> limit = 100, 100, 100<br /> </gensens><br /> ----------------<br /> To: <a href="mailto:mon...@li..." rel="noopener noreferrer">mon...@li...</a> <<a href="mailto:monitorix" rel="noopener noreferrer">mailto:monitorix</a>-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a>> (monitorix-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a><br /> <<a href="mailto:ge...@li..." rel="noopener noreferrer">mailto:ge...@li...</a>>);<br /> Cc: Jordi Sanfeliu (<a href="mailto:jo...@fi..." rel="noopener noreferrer">jo...@fi...</a><br /> <<a href="mailto:jo...@fi..." rel="noopener noreferrer">mailto:jo...@fi...</a>>);<br /> Subject: [Monitorix-general] [SPAM] want to monitor ping with<br /> monitorix;<br /> 14.08.2025, 12:45, "Jordi Sanfeliu via Monitorix-general"<br /> <monitorix-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a><br /> <<a href="mailto:ge...@li..." rel="noopener noreferrer">mailto:ge...@li...</a>>>:<br /> <br /> Hello,<br /> <br /> If you use only a single script to execute these two<br /> commands you must<br /> keep in mind that the second command will be executed 5<br /> seconds later.<br /> That won't scale well if you plan to track more pings.<br /> Better use a<br /> crontab line for each command.<br /> <br /> I don't know that is 'fcron', I only have 'cronie' in my<br /> Fedora.<br /> <br /> Regarding the error in the log file, can you, please,<br /> 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:<br /> <br /> I am using this command as per https://<br /> <a href="https://www.monitorix.org/" rel="noopener noreferrer">www.monitorix.org/</a> <<a href="https://www.monitorix.org/" rel="noopener noreferrer">https://www.monitorix.org/</a>><br /> faq.html <<a href="https://www.monitorix.org/faq.html" rel="noopener noreferrer">https://www.monitorix.org/faq.html</a> <https://<br /> <a href="https://www.monitorix.org/faq.html" rel="noopener noreferrer">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> <https://<br /> <a href="https://www.monitorix.org/faq.html" rel="noopener noreferrer">www.monitorix.org/faq.html</a>> <https://<br /> <a href="https://www.monitorix.org/faq.html" rel="noopener noreferrer">www.monitorix.org/faq.html</a> <<a href="https://www.monitorix.org/" rel="noopener noreferrer">https://www.monitorix.org/</a><br /> faq.html>>> (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 ==<br /> "" ) { print<br /> "0/0/0/0" } else { print $4}}' | awk -F / '{print<br /> $2 }' > /tmp/<br /> ping1_results.txt ping -c 5 -nq 8.8.4.4 | tail -1 |<br /> awk '{if<br /> ( $4 ==<br /> "" ) { print "0/0/0/0" } else { print $4}}' | awk -<br /> F / '{print<br /> $2 }' > /<br /> tmp/ping2_results.txt |<br /> <br /> I have created a shell script with above commands.<br /> When the<br /> script is<br /> run manually it is working fine. Getting the two<br /> graphs in<br /> monitorix.<br /> <br /> But when same script is run in fcron only ping2 graph is<br /> 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<br /> value $val in<br /> division (/) at /usr/lib64/monitorix/gensens.pm line<br /> 156.<br /> <br /> What I have tried: Disabling fcron entry and running<br /> script<br /> 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> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a>-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a>> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a>>-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a><br /> <<a href="mailto:ge...@li..." rel="noopener noreferrer">mailto:ge...@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><br /> <<a href="https://lists.sourceforge.net/lists/listinfo/monitorix-general" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix-general</a>><br /> <<a href="https://lists.sourceforge.net/lists/listinfo/" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/</a><br /> monitorix-general <<a href="https://lists.sourceforge.net/lists/listinfo/" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/</a><br /> monitorix-general>><br /> <br /> --<br /> Jordi Sanfeliu<br /> FIBRANET Network Services Provider<br /> <a href="https://www.fibranet.cat/" rel="noopener noreferrer">https://www.fibranet.cat</a> <<a href="https://www.fibranet.cat/" rel="noopener noreferrer">https://www.fibranet.cat/</a>> <https://<br /> <a href="https://www.fibranet.cat/" rel="noopener noreferrer">www.fibranet.cat/</a> <<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> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a>-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a>> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a> <<a href="mailto:Monitorix" rel="noopener noreferrer">mailto:Monitorix</a>>-<br /> <a href="mailto:ge...@li..." rel="noopener noreferrer">ge...@li...</a><br /> <<a href="mailto:ge...@li..." rel="noopener noreferrer">mailto:ge...@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><br /> <<a href="https://lists.sourceforge.net/lists/listinfo/monitorix-general" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix-general</a>><br /> <<a href="https://lists.sourceforge.net/lists/listinfo/monitorix" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix</a>-<br /> general <<a href="https://lists.sourceforge.net/lists/listinfo/monitorix" rel="noopener noreferrer">https://lists.sourceforge.net/lists/listinfo/monitorix</a>-<br /> general>><br /> <br /> Sincerely,<br /> Wilson Rodrigues<br /> <br /> --<br /> Jordi Sanfeliu<br /> FIBRANET Network Services Provider<br /> <a href="https://www.fibranet.cat/" rel="noopener noreferrer">https://www.fibranet.cat</a> <<a href="https://www.fibranet.cat/" rel="noopener noreferrer">https://www.fibranet.cat/</a>><br /> <br /> <br /> Sincerely,<br /> Wilson Rodrigues</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 /> </blockquote><div> </div><div> </div><div>Sincerely,<br />Wilson Rodrigues</div><div> </div> |