LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2009, 11:54 AM   #1
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
MRTG config sanity check


Hello,

I have been trying for hours to get this MRTG graph to work, with no success, so it's time for me to step back and ask for a fresh set of eyes.

What I'm trying to do is graph the number of Web site hits in the past 5 minutes. Here is my script that does so:
Code:
alucard@piett:~$ cat hits.pl
#!/usr/bin/env perl

use strict; use warnings;
use LWP::Simple;

my $data = get("http://127.0.0.1/server-status?auto");
$data =~ /Total Accesses: (\d+)/;

print "$1\n$1\n";
Here is the output:
Code:
alucard@piett:~$ perl hits.pl
2570
2570
As you can see, it works there. Here is my mrtg.cfg:
Code:
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c

# Global configuration
WorkDir: /var/www/mrtg
#WriteExpires: Yes

Title[^]: Traffic Analysis for


EnableIPv6: no
YSize[_]: 250
YTics[_]: 6
Suppress[_]: ym
RunAsDaemon: yes
Interval:    5
# [...]
Target[hits]: `perl /home/alucard/hits.pl`
Title[hits]: Site hits for piett
Options[hits]: growright, pngdate, nopercent, noinfo
MaxBytes[hits]: 1000000
YLegend[hits]: # Hits
PageTop[hits]: <h1>Site hits for piett</h1>
  <p>Total Web site hits per interval</p>
MRTG is running, but the hits graph is not working. I ran indexmaker and you can see the MRTG page *edit*. The graph is being changed every five minutes (the date changes), but no data points are being graphed.

Can anyone see what I'm missing? How can I debug this further?

Last edited by AlucardZero; 02-24-2009 at 07:54 PM.
 
Old 02-24-2009, 07:55 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Multiplying my data output by 100 started actually getting me data points on the graph. I'll play with that and Factor / YTicsFactor now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
config.log shows failure in sanity check for wxGTK on Fedora platform rfee Linux - Software 1 10-25-2008 12:24 AM
Need LVM sanity check flashl Fedora 6 07-16-2007 08:56 PM
Sanity Check DotHQ Linux - General 6 03-31-2006 09:24 PM
cpp sanity check alexrait1 Slackware 6 04-24-2005 08:43 AM
Quick Sanity Check sub-genius Slackware 5 07-15-2003 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration