Discussion:
[Monitorix-general] Network Traffic and Usage, FreeBSD 10
Sergey Andreyev
2014-09-09 11:37:59 UTC
Permalink
Hello!

It seems like monitorix's net.pm got in trouble again with new release of
FreeBSD.
I have installed monitorix using pkg and found out that Network usage
graphs are empty while packets and errors are high.
After some research I have found that trouble is in the line with condition
for FreeBSD version check.

Here is my configuration:

uname -a
FreeBSD apt 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul 8 06:34:23
UTC 2014 ***@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
i386

pkg info|grep monitorix
monitorix-3.5.1 Web based monitoring system

part of NET graph from monitorix.conf
# NET graph
#
-----------------------------------------------------------------------------
<net>
list = vr0, ste0
<desc>
vr0 = FastEthernet LAN, 0, 1000
ste0 = FastEthernet WAN, 0, 1000
</desc>
gateway = vr0
</net>

I had to comment this check in net.pm

# Idrop column added in 8.0
if($config->{kernel} gt "7.2")

and leave parse line as for 8.0 and higher version as is.
(undef, undef, undef, undef, $net_packs_in[$n], $net_error_in[$n], undef,
$net_bytes_in[$n], $net_packs_out[$n], $net_error_out[$n],
$net_bytes_out[$n]) = split(' ', $_);

Then Monitorix is working as intended.

So it seems like that "$config->{kernel} gt "7.2" is not working for
FreeBSD 10.0
I did not dig deeper in the code to find out how does that
$config->{kernel} variable sets, but I can guess it has trouble with its
length, may be it parses 10.0 to 0.0, but i don't know :)
--
with best regards
Sergey Andreyev
Jordi Sanfeliu
2014-09-09 14:03:08 UTC
Permalink
Hello Sergey,

I've checked all this and you're right, the code must use the character
greater than '>' instead of the operator 'gt' since the comparison is
numerical.

So please, change your line to:

if($config->{kernel} > "7.2")

and let me know if it works for you.
Thanks.


On 09/09/2014 01:37 PM, Sergey Andreyev wrote:
[...]>
Post by Sergey Andreyev
So it seems like that "$config->{kernel} gt "7.2" is not working for
FreeBSD 10.0
I did not dig deeper in the code to find out how does that
$config->{kernel} variable sets, but I can guess it has trouble with its
length, may be it parses 10.0 to 0.0, but i don't know :)
--
with best regards
Sergey Andreyev
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat
Sergey Andreyev
2014-09-09 14:30:32 UTC
Permalink
Hello Jordi,

I've replaced 'gt' to '>' in that line and network usage works as intended
now.

Thank you very much for help and Monitorix!

P.S. I know that there is newer version of monitorix - 3.6.0 and i see that
it has the same problem. I hope next version of monitorix added to FreeBSD
packages (3.6.0 is still not there) will have patch or changes made in this
line ;-)
Post by Jordi Sanfeliu
Hello Sergey,
I've checked all this and you're right, the code must use the character
greater than '>' instead of the operator 'gt' since the comparison is
numerical.
if($config->{kernel} > "7.2")
and let me know if it works for you.
Thanks.
[...]>
Post by Sergey Andreyev
So it seems like that "$config->{kernel} gt "7.2" is not working for
FreeBSD 10.0
I did not dig deeper in the code to find out how does that
$config->{kernel} variable sets, but I can guess it has trouble with its
length, may be it parses 10.0 to 0.0, but i don't know :)
--
with best regards
Sergey Andreyev
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Monitorix-general mailing list
https://lists.sourceforge.net/lists/listinfo/monitorix-general
--
with best regards
Sergey Andreyev
Jordi Sanfeliu
2014-09-09 14:40:56 UTC
Permalink
Hello Sergey,

Great!, I'll fix the current tree right now.

I'll also tell to Chris Rees (the current Monitorix packager for
FresBSD) to take care of this bug.

Thank you very much.
Best regards.
Post by Sergey Andreyev
Hello Jordi,
I've replaced 'gt' to '>' in that line and network usage works as
intended now.
Thank you very much for help and Monitorix!
P.S. I know that there is newer version of monitorix - 3.6.0 and i see
that it has the same problem. I hope next version of monitorix added to
FreeBSD packages (3.6.0 is still not there) will have patch or changes
made in this line ;-)
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat
Jordi Sanfeliu
2014-09-09 15:53:19 UTC
Permalink
UPDATE:

Chris Rees has just submitted a bug fix for 3.5.1 (3.5.1_1):

<http://svnweb.freebsd.org/ports?view=revision&revision=367743>
<http://www.freshports.org/sysutils/monitorix/>

Thanks!
Best regards.
Post by Jordi Sanfeliu
Hello Sergey,
Great!, I'll fix the current tree right now.
I'll also tell to Chris Rees (the current Monitorix packager for
FresBSD) to take care of this bug.
Thank you very much.
Best regards.
Post by Sergey Andreyev
Hello Jordi,
I've replaced 'gt' to '>' in that line and network usage works as
intended now.
Thank you very much for help and Monitorix!
P.S. I know that there is newer version of monitorix - 3.6.0 and i see
that it has the same problem. I hope next version of monitorix added to
FreeBSD packages (3.6.0 is still not there) will have patch or changes
made in this line ;-)
--
Jordi Sanfeliu
FIBRANET Network Services Provider
http://www.fibranet.cat

La informació inclosa en aquest correu electrònic és CONFIDENCIAL. Si
llegiu aquest missatge i no sou el destinatari indicat, us informem que
està totalment prohibida qualsevol utilització, divulgació, distribució
i/o reproducció d'aquesta comunicació, total o parcial, sense
autorització expressa en virtut de la legislació vigent. Si heu rebut
aquest missatge per error, us preguem que ens ho notifiqueu
immediatament per aquesta via i procediu a la seva eliminació juntament
amb els fitxers annexes sense llegir-lo ni gravar-lo.

En virtut d'allò establert a la Llei 15/1999 i la LSSICE 34/2002, us
informem que les vostres dades formen part d'un fitxer automatitzat
titularitat de FIBRANET NSP, SL La informació registrada s'utilitzarà
per informar-vos, per qualsevol mitjà electrònic, de les nostres
novetats comercials. Podeu exercir els vostres drets d'accés,
rectificació, cancel·lació i oposició a la següent adreça: Polígon Pla
d'en Boet, C/ BATISTA I ROCA, 8 2a PLANTA, 08302 MATARÓ (BARCELONA).
En compliment de la Llei 34/2002 de l'11 de juliol de Serveis de la
Societat de la Informació i del Comerç Electrònic, us informem que podeu
revocar en qualsevol moment, de forma senzilla i gratuïta, el
consentiment per a la recepció de correu electrònic, enviant un correu
electrònic amb la vostra sol·licitud a: ***@fibranet.cat.
Continue reading on narkive:
Loading...