Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SNMP & MRTG made in easy (Power Under Control ;)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
skeezer
n00b
n00b


Joined: 09 Aug 2004
Posts: 10
Location: Tampere

PostPosted: Tue Nov 02, 2004 6:43 pm    Post subject: Reply with quote

I get this error when running cpu.sh:
Code:
ERROR: Target[localhost.cpu][_IN_] ' $target->[0]{$mode} +ssCpuRawSystem.0&ssCpuRawSystem.' (warn): Ambiguous use of & resolved as operator & at (eval 7) line 1.
ERROR: Target[localhost.cpu][_OUT_] ' $target->[0]{$mode} +ssCpuRawSystem.0&ssCpuRawSystem.' (warn): Ambiguous use of & resolved as operator & at (eval 8) line 1.

What's reason for this and how it could be solved?

My cpu.cfg looks like this:
Code:
WorkDir: /var/www/localhost/htdocs/mrtg/cpu
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@localhost+ssCpuRawSystem.0&ssCpuRawSystem.
0:public@localhost + ssCpuRawNice.0&ssCpuRawNice.0:public@localhost
RouterUptime[localhost.cpu]: public@localhost
MaxBytes[localhost.cpu]: 100
Title[localhost.cpu]: CPU Load
PageTop[localhost.cpu]: <H1>Active CPU Load %</H1>
Unscaled[localhost.cpu]: ymwd
ShortLegend[localhost.cpu]: %
YLegend[localhost.cpu]: CPU Utilization
Legend1[localhost.cpu]: Active CPU in % (Load)
Legend2[localhost.cpu]:
Legend3[localhost.cpu]:
Legend4[localhost.cpu]:
LegendI[localhost.cpu]:  Active
LegendO[localhost.cpu]:
Options[localhost.cpu]: growright,nopercent


Thanks for the answers
Back to top
View user's profile Send private message
banderos
n00b
n00b


Joined: 16 Oct 2004
Posts: 73
Location: Australia

PostPosted: Fri Nov 05, 2004 4:11 am    Post subject: Reply with quote

I had the exact same problem but managed to figure it out.

Basically it is a cut & paste problem....you will find there's carraige returns in the target line that shouldn't be there.

That's all!
Back to top
View user's profile Send private message
cron0
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2004
Posts: 132
Location: Montreal, Quebec

PostPosted: Fri Nov 05, 2004 4:33 pm    Post subject: Where is libgd? Reply with quote

Strange, media-libs/libgd do not exist anymore...

I've searched gentoo-portage.com and it's not there!
Could it have been replaced by app-sci/libgdgeda ?

Code:
*  app-sci/libgdgeda [ Masked ]
      Latest version available: 2.0.15
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 510 kB
      Homepage:    http://www.geda.seul.org
      Description: libgdgeda - a PNG creation library for gEDA
      License:     GPL-2


Or else, where it is?

EDIT: Nevermind, it's media-libs/gd
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sat Nov 06, 2004 1:21 pm    Post subject: Reply with quote

Thanks for the howto.

I have been running this for a few weeks now. Within the last week, and I don't remember what I did, I now get emails from cron that say:
Code:
ERROR: It looks as if you are running two copies of mrtg in parallel on
       the same config file. There is a lockfile (/etc/mrtg/ping.cfg_l) and it is
       is only 0 seconds old ... Check your crontab.
       (/etc/crontab and /var/spool/cron/root)
run-parts: /etc/cron.mrtg/ping.sh exited with return code 17
what is wrong?

Thx
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
banderos
n00b
n00b


Joined: 16 Oct 2004
Posts: 73
Location: Australia

PostPosted: Sun Nov 07, 2004 9:18 am    Post subject: Reply with quote

Just stop mrtg and delete all the *_l files in your working directory and the message should go away.
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sun Nov 07, 2004 1:39 pm    Post subject: Reply with quote

Thanks for your response.

I am not running mrtg as a daemon. I am running it from cron, as per the instructions. I did a
Code:
ps aux | grep mrtg
to make sure nothing was running. There are no _l files in /etc/mrtg directory. I checked for hidden file also.

I will have to look deeper. I was hoping this was something easy.

Thanks for the idea.
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sun Nov 07, 2004 2:03 pm    Post subject: Reply with quote

OK. After thinking about it for 30 seconds I realized it is trying to run in parallel. For some reason the cronjob had been changed to have it run every 1 minute. I have change it back to every 5 minutes.

Thanks again for the help. It just didn't occur to me at first but now that I know, it is obvious.

Thx
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Thu Dec 16, 2004 6:09 am    Post subject: Reply with quote

Can anyone test the following, and see if the values are correct:
Code:

### Memmory Usage ###
Target[memory]:memTotalReal.0&memTotalReal.0:public@localhost - memAvailReal.0&memAvailReal.0:public@localhost - memCached.0&memCached.0:public@localhost
MaxBytes[memory]: 600000
Title[memory]: Physical memory usage
PageTop[memory]: <H1>Physical memory usage</H1>
Unscaled[memory]: ymwd
YLegend[memory]: Memory Usage
Legend1[memory]: Real memory in use
Legend2[memory]:
Legend3[memory]:
Legend4[memory]:
LegendI[memory]: real mem in use :
LegendO[memory]:
ShortLegend[memory]: B
kMG[memory]: K,M,G,T,P
Options[memory]: gauge,nopercent,transparent,noborder,growright


I do think that this works perfect with the 2.6 kernel and an updated snmp version, but I might be wrong. This also subtracts the reserved/cached/buffered ram (whatever you want to call it).
Back to top
View user's profile Send private message
Tuinslak
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2003
Posts: 129
Location: Belgium

PostPosted: Thu Dec 16, 2004 9:06 am    Post subject: Reply with quote

Yes, it seems to work.
(http://tiete.ath.cx:1337/mrtg/memory.html edit: link is offline.)

edit: nop, doesn't work well, after some mrtg updated it starts telling my I got 1500mb ram (I got 512)
_________________
Tuinslak


Last edited by Tuinslak on Tue Jan 25, 2005 9:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Thu Dec 16, 2004 5:14 pm    Post subject: Reply with quote

You can look at mine:

http://scygro.ath.cx/mrtg/memory.html

Anyone else tried it yet?

Mine seems to work, although, it hasn't gone past 331.9 mb on a 512mb machine. What can I use to really fill up all the ram and keep it filled? So we can test this?
Back to top
View user's profile Send private message
Tuinslak
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2003
Posts: 129
Location: Belgium

PostPosted: Thu Dec 16, 2004 5:58 pm    Post subject: Reply with quote

(re)emerge system or something :p
_________________
Tuinslak
Back to top
View user's profile Send private message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Thu Dec 16, 2004 9:03 pm    Post subject: Reply with quote

heh?
Back to top
View user's profile Send private message
Tuinslak
Tux's lil' helper
Tux's lil' helper


Joined: 26 Nov 2003
Posts: 129
Location: Belgium

PostPosted: Thu Dec 16, 2004 9:20 pm    Post subject: Reply with quote

Tuinslak wrote:
(re)emerge system or something :p


-->
Quote:
What can I use to really fill up all the ram and keep it filled? So we can test this?

_________________
Tuinslak
Back to top
View user's profile Send private message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Thu Dec 16, 2004 10:04 pm    Post subject: Reply with quote

emerge system does definately not fill up 512mb?
Back to top
View user's profile Send private message
heutger
n00b
n00b


Joined: 13 Apr 2004
Posts: 9

PostPosted: Sat Dec 18, 2004 1:04 am    Post subject: Mem & Swap values Reply with quote

I believe the easiest way to bring mem and swap into MRTG would be to use also therefore the already existing hrStorage-values, working fine for me as 4 is / (hd) the 2 is my mem and 3 is my swap. Verifying this values with the results of proc/meminfo they work correctly.

And to another recent question, to grow all values from right use growright ;-)
Back to top
View user's profile Send private message
SavageMindz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Oct 2002
Posts: 87
Location: The bit of hell that has frozen over.

PostPosted: Sun Dec 19, 2004 7:28 am    Post subject: Reply with quote

Ok I have two small questions...

1) Why does this not work. Trying to get the disk io in and out for a given partition.
Code:
cat io-disk.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-DISKIO-MIB.txt
Target[localhost.diskio]: diskIOReads.3&diskIOWrites.3:public@localhost
RouterUptime[localhost.diskio]: public@localhost
MaxBytes[localhost.diskio]: 1000000000000000
WorkDir: /var/www/localhost/mrtg
Title[localhost.diskio]: DISK IO
PageTop[localhost.diskio]: <H1>DISK IO /home & /storage</H1>
ShortLegend[localhost.diskio]: bytes
YLegend[localhost.diskio]: DISK Utilization
Legend1[localhost.diskio]: /home disk
Legend2[localhost.diskio]: /storage disk
Legend3[localhost.diskio]:
Legend4[localhost.diskio]:
LegendI[localhost.diskio]: No. of reads
LegendO[localhost.diskio]: No. of writes
Options[localhost.diskio]: growright,gauge,nopercent


On the scale iit flatlines at 1.0. That is both tha bar for reads and the line for writes. Suffice to say its a fairly busy drive so I don't believe the graph.

Btw on running this from the command line I get;

Code:
Use of uninitialized value in concatenation (.) or string at /usr/bin/../lib/mrtg2/SNMP_util.pm line 1266, <MIB> line 42.
Use of uninitialized value in concatenation (.) or string at /usr/bin/../lib/mrtg2/SNMP_util.pm line 1266, <MIB> line 158.
cannot encode Object ID .15.1.1.5.3: first subid too big in Object ID 15.1.1.5.3 at /usr/bin/mrtg line 1846
ERROR: Target[localhost.diskio][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
ERROR: Target[localhost.diskio][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data


Anyone know what I'm doing wrong.

Anyway on to muy other question. Given that the above example was working is there anyway for me to change the green filled line to just a line without fill (like the blue one) but keep the blue line as is. I want a graph with two lines drawn and no fill area. Been through the docs but I can't find any mention to this.

Everything else seems to work great. Thanks for the How-to.

Savage

EDIT: I should probably point out that I put the following in snmp.conf to specify the disks I want

Code:
disk   /   100000
disk   /home   100000
disk   /storage   100000
Back to top
View user's profile Send private message
ranmakun
Guru
Guru


Joined: 06 Nov 2002
Posts: 372
Location: Buenos Aires - Argentina

PostPosted: Sun Feb 06, 2005 7:10 pm    Post subject: Uptime graph Reply with quote

I've made an uptime graph, if anyone is interested:

uptime.cfg
Code:

WorkDir: /PATH/TO/MRTG
Title[localhost.uptime]: System Uptime
PageTop[localhost.uptime]: <H1>System Uptime</H1>
RouterUptime[localhost.uptime]: public@localhost
Target[localhost.uptime]: `/etc/mrtg/uptime.pl`
MaxBytes[localhost.uptime]: 50000
ShortLegend[localhost.uptime]: hours
Options[localhost.uptime]: growright,unknaszero,nopercent,gauge
LegendI[localhost.uptime]: Uptime
LegendO[localhost.uptime]:
Legend1[localhost.uptime]: Maximum uptime in hours
YLegend[localhost.uptime]: Time (hours)


uptime.pl
Code:

#!/usr/bin/perl
use warnings;
use strict;

my $uptime = `/usr/bin/snmpwalk -v 2c -c public localhost hrSystemUptime`;
$uptime =~ /\((\d+)\)/;
my $hours = $1 / 360000;
printf "%.0f\n",$hours;
printf "%.0f\n",$hours;
Back to top
View user's profile Send private message
ranmakun
Guru
Guru


Joined: 06 Nov 2002
Posts: 372
Location: Buenos Aires - Argentina

PostPosted: Sun Feb 06, 2005 7:24 pm    Post subject: Reply with quote

SavageMindz wrote:
Ok I have two small questions...

1) Why does this not work. Trying to get the disk io in and out for a given partition.
Code:
cat io-disk.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-DISKIO-MIB.txt
Target[localhost.diskio]: diskIOReads.3&diskIOWrites.3:public@localhost
RouterUptime[localhost.diskio]: public@localhost
MaxBytes[localhost.diskio]: 1000000000000000
WorkDir: /var/www/localhost/mrtg
Title[localhost.diskio]: DISK IO
PageTop[localhost.diskio]: <H1>DISK IO /home & /storage</H1>
ShortLegend[localhost.diskio]: bytes
YLegend[localhost.diskio]: DISK Utilization
Legend1[localhost.diskio]: /home disk
Legend2[localhost.diskio]: /storage disk
Legend3[localhost.diskio]:
Legend4[localhost.diskio]:
LegendI[localhost.diskio]: No. of reads
LegendO[localhost.diskio]: No. of writes
Options[localhost.diskio]: growright,gauge,nopercent


On the scale iit flatlines at 1.0. That is both tha bar for reads and the line for writes. Suffice to say its a fairly busy drive so I don't believe the graph.

Btw on running this from the command line I get;

Code:
Use of uninitialized value in concatenation (.) or string at /usr/bin/../lib/mrtg2/SNMP_util.pm line 1266, <MIB> line 42.
Use of uninitialized value in concatenation (.) or string at /usr/bin/../lib/mrtg2/SNMP_util.pm line 1266, <MIB> line 158.
cannot encode Object ID .15.1.1.5.3: first subid too big in Object ID 15.1.1.5.3 at /usr/bin/mrtg line 1846
ERROR: Target[localhost.diskio][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
ERROR: Target[localhost.diskio][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data


Anyone know what I'm doing wrong.


Maybe, I don't know much about how to configure snmp, I've followed the guide in this thread, but in my machine snmpwalk doesn't show that MIB. Maybe you don't have it either and that's the error you get from MRTG "did not eval into defined data". I would really like a graph like this too.
To see all the MIBs in your machine run:
Code:
snmpwalk -v 2c -c public localhost


Quote:

Anyway on to muy other question. Given that the above example was working is there anyway for me to change the green filled line to just a line without fill (like the blue one) but keep the blue line as is. I want a graph with two lines drawn and no fill area. Been through the docs but I can't find any mention to this.


I think that if you want to do that you should store MRTG data in rrd databases and make the graphs with rrdtool. I've never used MRTG with rrd's but I know it can be done. I use rrdtool frequently to make graphs from rrd databases and it's an excelent tool, you'll have the graphs exactly as you want them. I think there is a tutorial in this forum to use MTRG with rrdtool.
Back to top
View user's profile Send private message
SavageMindz
Tux's lil' helper
Tux's lil' helper


Joined: 28 Oct 2002
Posts: 87
Location: The bit of hell that has frozen over.

PostPosted: Tue Feb 08, 2005 10:53 pm    Post subject: Reply with quote

ranmakun thanks for the info. I might give rrdtool a try when I have soem spare time.

Cheers

Savage
Back to top
View user's profile Send private message
WillRivendell
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2004
Posts: 144

PostPosted: Fri Feb 11, 2005 12:30 am    Post subject: Reply with quote

hey ive never set up webserver in gentoo....

i instaleld mini_httpd and apache but its nothing like debian.

what file do i edit to show server where root doc is.... and where is the root doc i want?/

/var/www/localhost/www ?? that where it is....


??

i want to be able to get to this remtoely.....

thanks
Back to top
View user's profile Send private message
ranmakun
Guru
Guru


Joined: 06 Nov 2002
Posts: 372
Location: Buenos Aires - Argentina

PostPosted: Fri Feb 11, 2005 12:47 am    Post subject: Reply with quote

WillRivendell wrote:
hey ive never set up webserver in gentoo....

i instaleld mini_httpd and apache but its nothing like debian.

what file do i edit to show server where root doc is.... and where is the root doc i want?/

/var/www/localhost/www ?? that where it is....


??

i want to be able to get to this remtoely.....

thanks


Not sure the default location, but the configuration of apache is in /etc/apache/conf/apache.conf for apache 1 and /etc/apache/conf/apache2.conf and /etc/apache2/conf/commonapache2.conf for apache 2
Back to top
View user's profile Send private message
WillRivendell
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2004
Posts: 144

PostPosted: Mon Feb 14, 2005 8:01 pm    Post subject: Reply with quote

Ok I got everythin working.... (memory displays at 2000Gb instead of 2000Mb.. but thats minor)


one issue I cant resolve is the DISKSPACE

I made the cfg but when I run the sh i get



Code:
ERROR: CFG Error Unknown Option "shortlegendlocalhost.partition-name[]" on line 8 or above.
           Check doc/reference.txt for Help



this did work without error once tho....problem is that how do I make it display a graph for it... what do i add to index page?


thanks
Back to top
View user's profile Send private message
bgrade
n00b
n00b


Joined: 03 Feb 2005
Posts: 35

PostPosted: Wed Feb 16, 2005 1:23 am    Post subject: Reply with quote

my swap stopped working, it was working fine for ages and now it just reports 1k !?

http://28smith.com/mrtg/localhost.swap.html

i did do a lot of updates but dont know what might have broken it.

the swap still seems to be runnign fine on the machine..

fry mrtg # cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 1057538048 395091968 662446080 0 16900096 236806144
Swap: 1028149248 0 1028149248
MemTotal: 1032752 kB
MemFree: 646920 kB
MemShared: 0 kB
Buffers: 16504 kB
Cached: 231256 kB
SwapCached: 0 kB
Active: 146832 kB
Inactive: 189508 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 1032752 kB
LowFree: 646920 kB
SwapTotal: 1004052 kB
SwapFree: 1004052 kB

any ideas?

fry mrtg # more /etc/mrtg/swap.cfg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[localhost.swap]: memAvailSwap.0&memAvailSwap.0:public@localhost
PageTop[localhost.swap]: <H1>Swap Memory</H1>
WorkDir: /var/www/localhost/mrtg
Options[localhost.swap]: nopercent,growright,gauge,noinfo
Title[localhost.swap]: Free Memory
MaxBytes[localhost.swap]: 1000000
kMG[localhost.swap]: k,M,G,T,P,X
YLegend[localhost.swap]: bytes
ShortLegend[localhost.swap]: bytes
LegendI[localhost.swap]: Free Memory:
LegendO[localhost.swap]:
Legend1[localhost.swap]: Swap memory avail, in bytes


EDIT: hmmm, and also fry

mrtg # snmpwalk -v 2c -c public localhost memAvailSwap.0
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 1004052

seems to return the correct figure..
Back to top
View user's profile Send private message
defkewl
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2005
Posts: 75
Location: Indonesia

PostPosted: Fri Mar 25, 2005 8:52 am    Post subject: Reply with quote

I can't view it via my webserver since the document root is located in /var/www/localhost/htdocs
_________________
Not all things in life need reasoning
Visit my blog
Back to top
View user's profile Send private message
GodMoney
n00b
n00b


Joined: 26 Mar 2005
Posts: 5

PostPosted: Sat Mar 26, 2005 5:25 am    Post subject: Reply with quote

Does anyone know how to get mrtg working with snmpv3 ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum