I want to monitor its number of postgresql processes, cpu usage, and RAM usage. 


> ----- Original Message -----
> From: "eric draven" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: [plug] monitor postgreSQL
> Date: Tue, 21 Mar 2006 09:07:51 +0800
> 
> 
> What exactly do you want to monitor that is related to postgresql? IMHO,
> SNMP is not a direct requirement in implementing MRTG. You could just use
> ssh passwordless logins and a handful of scripts to monitor your box.
> 
> Usually I monitor disk space growth with a script that is plugged into MRTG.
> It looks like this:
> 
> #!/usr/bin/perl
> 
> $ret = `df --block-size=1024 -P $ARGV[0] | grep -v Filesystem`;
> $ret =~ s/($ARGV[0])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])(.*
> )(.*[0-9])%(.* )//;
> 
> print "megabytes:$7 percent:$9";
> 
> For cpu activity, I use this:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> $|++;
> 
> my $host=`/bin/hostname`;
> my $upt=`/usr/bin/uptime `;
> my @uptime=split(/,/, $upt);
> my $mult=100;
> #while ($upt =~ /,\ /g) {$uptim = $upt};
> chomp $host;
> 
> #while(1) {
> 
> open(LOAD,"/proc/loadavg") || die "Couldn't open /proc/loadavg: $!\n";
> 
> my @load=split(/ /,<LOAD>);
> close(LOAD);
> 
> for ($i=0;$i<=2;$i++) {
>          chomp $load[$i];
>          $load[$i] = scalar($load[($i)]) * $mult;
> }
> 
> #print "\033]0;";
> print "$load[0]\n";
> print "$load[1]\n";
> print "$load[2]\n";
> print "$uptime[0]$uptime[1]\n"; # for mtime, etc..
> #print "$uptim"; # for mtime, etc..
> print "$host\n";
> #print "$host: $load[0] $load[1] $load[2] at ", scalar(localtime);
> #print "\007";
> 
> #sleep 2;
> #}
> 
> On 3/20/06, Linux Win <[EMAIL PROTECTED]> wrote:
> >
> > Is there a way to monitor postgreSQL resource usage via graph say MRTG?
> >
> > --
> > _______________________________________________
> > Check out the latest SMS services @ http://www.linuxmail.org
> > This allows you to send and receive SMS through your mailbox.
> >
> > Powered by Outblaze
> > _________________________________________________
> > Philippine Linux Users' Group (PLUG) Mailing List
> > [email protected] (#PLUG @ irc.free.net.ph)
> > Read the Guidelines: http://linux.org.ph/lists
> > Searchable Archives: http://archives.free.net.ph
> >
> 
> 
> 
> --
> Suddenly, I heared a tapping, as of someone gently rapping, rapping at my
> chamber door...

>


-- 
_______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.

Powered by Outblaze
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to