/ Forside / Teknologi / Operativsystemer / Linux / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Linux
#NavnPoint
o.v.n. 11177
peque 7911
dk 4814
e.c 2359
Uranus 1334
emesen 1334
stone47 1307
linuxrules 1214
Octon 1100
10  BjarneD 875
Net-monitorering på linux rh 7.1 m. mrtg
Fra : Steffen Poulsen


Dato : 25-04-01 12:06

Jeg vil gerne bruge mrtg til at overvåge forskellige aktiviteter på en box -
men snmpd dør hele tiden - og det er bare standard-konfigurationen jeg
prøver på at køre.

Så når jeg starter den, kører den indtil jeg prøver en

snmpwalk -v 1 localhost public system

Som giver en 15-20 liniers udput, hvorefter den venter, får timeout, og så
er snmpd død.

Hvad er grunden til det - og mere interessant, hvordan får jeg det hele til
at spille nemmest muligt? Er der en mere stabil snmpd et sted (end den i
rh7.1 medfølgende, i hvert tilfælde)?

// Steffen

P.S.: /var/log/messages giver følgende under snmpwalk:

Apr 25 12:49:55 work ucd-snmp[692]: Received SNMP packet(s) from 127.0.0.1
Apr 25 12:49:55 work kernel: hdb: ATAPI 8X CD-ROM drive, 256kB Cache, DMA
Apr 25 12:49:55 work kernel: Uniform CD-ROM driver Revision: 3.12
Apr 25 12:49:55 work kernel: cdrom: open failed.
Apr 25 12:49:55 work kernel: SCSI subsystem driver Revision: 1.00
Apr 25 12:50:08 work kernel: end_request: I/O error, dev 02:00 (floppy),
sector 0

Og afslutter lidt senere, efter snmpwalk timer ud med:

Apr 25 13:00:00 work kernel: Uniform CD-ROM driver unloaded



 
 
Steffen Poulsen (25-04-2001)
Kommentar
Fra : Steffen Poulsen


Dato : 25-04-01 15:25

I øvrigt:

Hvis der er nogen der ved en nem måde at måle den aktuelle belastning på et
interface i kb/s på kunne det også være rigtigt interessant, måske bare et
lille script der læser en /proc tæller med et minuts mellemrum el. lign?

// Steffen



rene mikkelsen (25-04-2001)
Kommentar
Fra : rene mikkelsen


Dato : 25-04-01 18:27

In article <9c6mn3$c88$1@news.inet.tele.dk>, "Steffen Poulsen"
<steffenpoulsen@[removethis]usa.net> wrote:

> I øvrigt:
>
> Hvis der er nogen der ved en nem måde at måle den aktuelle belastning på
> et interface i kb/s på kunne det også være rigtigt interessant, måske
> bare et lille script der læser en /proc tæller med et minuts mellemrum
> el. lign?
>
> // Steffen

jowda .. jeg fik selv fat på en lille ting:

#!/usr/bin/perl

my $iface = $ARGV[0];

$in = 0;
$out = 0;
open(FIL, "/proc/net/dev");
while (<FIL>) {
chomp;
@line = split(/:/);
$line[1] =~ s/^\s+//;
@line2 = split(/\s+/,$line[1]);
if (substr($line[0],2,4) eq "$iface") {
$in += $line2[0];
$out += $line2[8];
}
}
close(FIL);

open(UPTIME,"cat /proc/uptime|") || die("Couldnt read from /proc/up\time");
$uptime = <UPTIME>;
close(UPTIME);
chomp($uptime);
my @uptimeparts = split /\./,$uptime;
# Convert to days/hours/minuts
# is there a simpler way to do this?
my $days = int($uptimeparts[0]/86400)." dage,";
my $leftover = ($uptimeparts[0] % 86400);
my $hours = '';
if (($leftover / 3600) > 1) {
$hours = int($leftover/3600)." timer,";
$leftover = ($leftover % 3600);
}
my $minutes = int($leftover/60)." minutter";
$uptime = "$days $hours $minutes";

print "$in\n$out\n$uptime\n\n";


---------

kaldes med : my-stats.pl [if]

den tilhørende mrtg.cfg:

WorkDir: /home/rene/public_html/mrtg_tmp

Target[eth0]: `/dir/til/my-stats.pl eth0`
Options[eth0]: growright
PageTop[eth0]: <H1>eth0 på [host]</H1>
<b>eth0 på [host]</b>
<br>
<br>
<TABLE>
<TR><TD>System:</TD><TD>yaddayadda</TD></TR>
<TR><TD>Maintainer:</TD><TD>[maintainer]</TD></TR>
<TR><TD>Interface:</TD><TD>eth0</TD></TR>
<TR><TD>IP:</TD><TD>[ip]</TD></TR>
</TABLE>


MaxBytes[eth0]: 1250000
Title[eth0]: eth0 usage

Target[eth1]: `/sti/til/my-stats.pl eth1`
Options[eth1]: growright
PageTop[eth1]: <H1>eth1 på [host]</H1>
<b>eth1 på [host]</b>
<br>
<br>
<TABLE>
<TR><TD>System:</TD><TD>[host]</TD></TR>
<TR><TD>Maintainer:</TD><TD>yaddayadda</TD></TR>
<TR><TD>Interface:</TD><TD>eth1</TD></TR>
<TR><TD>IP:</TD><TD>[ip]</TD></TR>
</TABLE>


MaxBytes[eth1]: 1250000
Title[eth1]: eth1 usage

-----------------
i cron:
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /sti/til/mrtg.cfg


/René

konartel (01-05-2001)
Kommentar
Fra : konartel


Dato : 01-05-01 22:18

Hi there,

I'm posting in English and I hope you can help me.

On Wed, 25 Apr 2001 13:06:02 +0200, Steffen Poulsen <steffenpoulsen@[Remove
This]usa.net> wrote:
>Apr 25 12:49:55 work ucd-snmp[692]: Received SNMP packet(s) from 127.0.0.1
>Apr 25 12:49:55 work kernel: hdb: ATAPI 8X CD-ROM drive, 256kB Cache, DMA
>Apr 25 12:49:55 work kernel: Uniform CD-ROM driver Revision: 3.12
>Apr 25 12:49:55 work kernel: cdrom: open failed.
>Apr 25 12:49:55 work kernel: SCSI subsystem driver Revision: 1.00
>Apr 25 12:50:08 work kernel: end_request: I/O error, dev 02:00 (floppy),
>sector 0

This particularly keeps me busy as well, as I try to install mrtg-2.9.12 for
some network monitoring with the ucd-snmp-4.2.1-1 package under RedHat 7.0
and I'm experiencing similar problems when running 'cfgmaker public@host'.

There seems to be little information about why this suddenly doesn't work
anymore with RedHat 7.0. The very annoying part is, that I have it all
working under 6.2, no problems there (it has, however an earlier version
of snmp).

Can any of you help me further?

Kind regards,
Marcel

Groningen, The Netherlands

Stig H. Jacobsen (01-05-2001)
Kommentar
Fra : Stig H. Jacobsen


Dato : 01-05-01 23:44

On Tue, 01 May 2001 21:18:09 GMT, konartel wrote:

>>Apr 25 12:49:55 work kernel: cdrom: open failed.
...
> This particularly keeps me busy as well, as I try to install mrtg-2.9.12 for
> some network monitoring with the ucd-snmp-4.2.1-1 package under RedHat 7.0
> and I'm experiencing similar problems when running 'cfgmaker public@host'.

I haven't experienced this myself, but my best guess is that a
'disk' entry in the snmpd.conf file is causing it.

--
Stig

konartel (02-05-2001)
Kommentar
Fra : konartel


Dato : 02-05-01 07:29

Hi Stig,

Thanks for replying.

On Tue, 01 May 2001 22:43:38 GMT, Stig H. Jacobsen <nzaa7en001@sneakemail.com>
wrote:
>I haven't experienced this myself, but my best guess is that a
>'disk' entry in the snmpd.conf file is causing it.

Probably. Very weird was also that the error about the floppy drive
continued to appear on my screen now and then. After an hour of trying
the only thing that worked was an init 1. But that's a very brute way.

Some of my logfiles read:
---
May 1 22:59:16 zork ucd-snmp[2139]: Received SNMP packet(s) from 127.0.0.1
May 1 22:59:16 zork modprobe: modprobe: Can't locate module block-major-8
May 1 22:59:16 zork last message repeated 6 times
May 1 22:59:16 zork kernel: end_request: I/O error, dev 02:00 (floppy), sector
0
---

Perhaps someone sees 'a light' in this.

Kind regards,
Marcel

Stig H. Jacobsen (02-05-2001)
Kommentar
Fra : Stig H. Jacobsen


Dato : 02-05-01 09:54

On Wed, 02 May 2001 06:29:01 GMT, konartel wrote:

>>I haven't experienced this myself, but my best guess is that a
>>'disk' entry in the snmpd.conf file is causing it.
> Probably.

So try commenting out all 'disk' entries in snmpd.conf and
restart it. Then you'll know if your problem is solved or not..

mrtg doesn't need disk-info from snmpd in a standard
configuration, so you won't break anything.

> Perhaps someone sees 'a light' in this.

It'll be faster if you work on it yourself instead of waiting for
"someone"..

--
Stig

konartel (02-05-2001)
Kommentar
Fra : konartel


Dato : 02-05-01 23:16

On Wed, 02 May 2001 08:54:18 GMT, Stig H. Jacobsen <nzaa7en001@sneakemail.com>
wrote:
>It'll be faster if you work on it yourself instead of waiting for
>"someone"..

Hehe.. You're right. I just wanted to make sure that I'm not re-inventing
the wheel. There's a lot of info about how things should work, and there's
even more on how things *don't* work, so I guess I'll try hacking some
config-files.

Thanks again,
Marcel

Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408892
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste