Re: [Monitorix-general] [SPAM] want to monitor ping with monitorix
Monitorix is a system monitoring tool
Brought to you by:
mikaku
From: Jordi S. <jo...@fi...> - 2025-08-14 07:15:22
|
Hello, If you use only a single script to execute these two commands you must keep in mind that the second command will be executed 5 seconds later. That won't scale well if you plan to track more pings. Better use a crontab line for each command. I don't know that is 'fcron', I only have 'cronie' in my Fedora. Regarding the error in the log file, can you, please, paste here the section <gensens> from your configuration file? Regards. On 8/14/25 08:30, wilson rodrigues wrote: > I am using this command as per https://www.monitorix.org/faq.html > <https://www.monitorix.org/faq.html> (Is there an easy way to integrate > a ping statistic?) > > |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 | > > 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. > > But when same script is run in fcron only ping2 graph is displaying > correctly. My crontab entry is > > * * * * * root sh /root/bin/monitorix_ping_gensens.sh > > Error in /var/log/monitorix is Use of uninitialized value $val in > division (/) at /usr/lib64/monitorix/gensens.pm line 156. > > What I have tried: Disabling fcron entry and running script manually > works fine. With fcron only ping2 graph is working. > > Sincerely, > Wilson Rodrigues > > > _______________________________________________ > Monitorix-general mailing list > Mon...@li... > https://lists.sourceforge.net/lists/listinfo/monitorix-general -- Jordi Sanfeliu FIBRANET Network Services Provider https://www.fibranet.cat |