Hello,
If running the scripts manually the graphs are created successfully then
the problem is in your crond daemon, not in Monitorix.
Don't show me the contents of these two files after executing the
scripts manually since we already know that it works this way. Please,
remove these files and let your crond create them, and then read their
contents and see if are correct.
Besides this, I see some errors in your log file that makes me think
that your configuration file is either outdated or you removed a lot of
lines from it, which is not recommended.
Please, read the FAQ <https://www.monitorix.org/faq.html#Q107> to know
how to configure Monitorix properly.
Regards.
On 8/14/25 10:30, wilson rodrigues wrote:Hello,
I misunderstood the purpose of running in parallel two cron jobs. Please
find attached the monitorix log
cat /tmp/ping1_results.txt
1.724
cat /tmp/ping2_results.txt
1.380
Please note running the scripts manually displays the graphs properly.
----------------
To: wilson rodrigues (wrodrigues...@yandex.com), monitorix-
gene...@lists.sourceforge.net (monitorix-general@lists.sourceforge.net);
Subject: [Monitorix-general] [SPAM] want to monitor ping with monitorix;
14.08.2025, 13:21, "Jordi Sanfeliu" <jo...@fibranet.cat>:
Hello,
The recommendation to use two commands is to have them run in parallel
instead of serial. Hence you can have multiple cron jobs running at the
same time. This suggestion didn't have any relationship with the errors
in your log file.
What are the contents of the files '/tmp/ping1_results.txt' and
'/tmp/ping2_results.txt'?
Also, please, paste you Monitorix log file.
Regards.
On 8/14/25 09:46, wilson rodrigues wrote:
Hello,
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.
Use of uninitialized value $val in division (/) at /usr/lib64/
monitorix/
gensens.pm line 156.
* * * * * root sh /root/bin/monitorix_ping1_gensens.sh
* * * * * root sh /root/bin/monitorix_ping2_gensens.sh
cat /etc/monitorix/conf.d/local.conf
# GENSENS graph
# Added on 2025-08-13
#
-----------------------------------------------------------------------------
<gensens>
<list>
0 = temp0
1 = temp1
</list>
<title>
0 = Pings1
1 = Pings2
</title>
<desc>
temp0 = /tmp/ping1_results.txt
temp1 = /tmp/ping2_results.txt
</desc>
<unit>
temp0 = 1
temp1 = 1
</unit>
<map>
temp0 = ping to ping1_results
temp1 = ping to ping2_results
</map>
<alerts>
</alerts>
rigid = 0, 0, 2
limit = 100, 100, 100
</gensens>
----------------
To: monitorix-general@lists.sourceforge.net <mailto:monitorix-
gene...@lists.sourceforge.net> (monitorix-
gene...@lists.sourceforge.net
<mailto:gene...@lists.sourceforge.net>);
Cc: Jordi Sanfeliu (jo...@fibranet.cat
<mailto:jo...@fibranet.cat>);
Subject: [Monitorix-general] [SPAM] want to monitor ping with
monitorix;
14.08.2025, 12:45, "Jordi Sanfeliu via Monitorix-general"
<monitorix-
gene...@lists.sourceforge.net
<mailto:gene...@lists.sourceforge.net>>:
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/ <https://www.monitorix.org/>
faq.html <https://www.monitorix.org/faq.html <https://
www.monitorix.org/faq.html>>
<https://www.monitorix.org/faq.html <https://
www.monitorix.org/faq.html> <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 ==
"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
Monitorix-general@lists.sourceforge.net <mailto:Monitorix-
gene...@lists.sourceforge.net> <mailto:Monitorix <mailto:Monitorix>-
gene...@lists.sourceforge.net
<mailto:gene...@lists.sourceforge.net>>
https://lists.sourceforge.net/lists/listinfo/monitorix-general
<https://lists.sourceforge.net/lists/listinfo/monitorix-general>
<https://lists.sourceforge.net/lists/listinfo/
monitorix-general <https://lists.sourceforge.net/lists/listinfo/
monitorix-general>>
--
Jordi Sanfeliu
FIBRANET Network Services Provider
https://www.fibranet.cat <https://www.fibranet.cat/> <https://
www.fibranet.cat/ <https://www.fibranet.cat/>>
_______________________________________________
Monitorix-general mailing list
Monitorix-general@lists.sourceforge.net <mailto:Monitorix-
gene...@lists.sourceforge.net> <mailto:Monitorix <mailto:Monitorix>-
gene...@lists.sourceforge.net
<mailto:gene...@lists.sourceforge.net>>
https://lists.sourceforge.net/lists/listinfo/monitorix-general
<https://lists.sourceforge.net/lists/listinfo/monitorix-general>
<https://lists.sourceforge.net/lists/listinfo/monitorix-
general <https://lists.sourceforge.net/lists/listinfo/monitorix-
general>>
Sincerely,
Wilson Rodrigues
--
Jordi Sanfeliu
FIBRANET Network Services Provider
https://www.fibranet.cat <https://www.fibranet.cat/>
Sincerely,
Wilson Rodrigues--
Jordi Sanfeliu
FIBRANET Network Services Provider
https://www.fibranet.cat
Wilson Rodrigues
_______________________________________________ Monitorix-general mailing list Monitorix-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monitorix-general