Koozali.org: home of the SME Server

Getting MRTG to work

Ed Burgstaler

Getting MRTG to work
« on: May 30, 2003, 09:01:38 AM »
Here is the output I get when I try to use MRTG  E-Smith/MITEL  How-To
  Ver. 0.7 (Dec-04-2001)
  Suitable for: E-Smith 4.1.2 / Mitel SME5

[root@mail /root]# ./create-mrtg 1001 192.168.10.8
./create-mrtg: the: command not found
./create-mrtg: It: command not found
./create-mrtg: will: command not found
./create-mrtg: second: command not found
Script started, file is is

Can someone tell me what's wrong?

Steven

Re: Getting MRTG to work
« Reply #1 on: May 30, 2003, 10:39:32 AM »
You've probably un-hashed the wrong lines, or you've just copy pasted?
If you copy pasted, the line sizes are different and you will have line that should be hashed out not being hashed.
Read the one that is only the site, and make sure the hashes are in the right place, if you still come unstuck, post the file, and I will look at it,.

Steven

Daley

Re: Getting MRTG to work
« Reply #2 on: May 30, 2003, 07:22:12 PM »
check with howto at http://sme.swerts-knudsen.dk/

Daley

Ed

Re: Getting MRTG to work
« Reply #3 on: May 30, 2003, 07:23:01 PM »
Thanks Steven

Now I just get a ":no such file or directory" error. Any ideas?

Steven

Re: Getting MRTG to work
« Reply #4 on: May 30, 2003, 07:39:29 PM »
I am on way away for the weekend, sorry, but I'll see if I can see the prob on monday if you can wait that long, I'm sure i had the same problem, just got to remember

Steven

Jesper Knudsen

Re: Getting MRTG to work
« Reply #5 on: June 01, 2003, 01:47:37 PM »
I have seen this problem before when you edit the create-mrtg file in Windows and then move it back to the SME server. Windows uses a different set of linebreak, CR. So make sure to edit the file in Linux (f.ex with PICO).

Rgds,
Jesper

Steven

Re: Getting MRTG to work
« Reply #6 on: June 02, 2003, 12:00:45 PM »
The problem I had which gave me the error was because I had left out a section of the howto, make sure you have read this carefully and followed it precisely - when you do a ./create-mrtg it is looking for a directory that you were supposed to have created earlier in the howto- if this is not the problem, let me know exactly where itgives you this error, and I will try help further.

Steven

Ed

Re: Getting MRTG to work
« Reply #7 on: June 03, 2003, 03:23:22 AM »
You were right ... I pasted the text wrong by not having my window maximized.

Problem fixed ... but why can I not monitor "localhost" the error is connection refused? Thanks again

Jesper

Re: Getting MRTG to work
« Reply #8 on: June 04, 2003, 01:09:23 AM »
That could very well be the hosts.allow template which you might not have altered :-)

Rgds,
Jesper

Ed Burgstaler

Re: Getting MRTG to work
« Reply #9 on: June 05, 2003, 09:57:46 AM »
What is it that you mean Jesper ... should I have altered it and if so what should I add the external interface IP?

Jesper

Re: Getting MRTG to work
« Reply #10 on: June 05, 2003, 12:36:40 PM »
If you want to access localhost only I would change it with the following commands:

[root@e-smith ]# mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow
[root@e-smith ]# echo "snmpd: 127.0.0.1, 192.168.212.0/255.255.255.0" > /etc/e-smith/templates-custom/etc/hosts.allow/snmpd
[root@e-smith ]# /sbin/e-smith/expand-template /etc/hosts.allow

Charlie

Re: Getting MRTG to work
« Reply #11 on: June 05, 2003, 08:27:32 PM »
Jesper wrote:

> If you want to access localhost only I would change it with
> the following commands:
>
> [root@e-smith ]# mkdir -p
> /etc/e-smith/templates-custom/etc/hosts.allow
> [root@e-smith ]# echo "snmpd: 127.0.0.1,
> 192.168.212.0/255.255.255.0"

That's local network, not local host.

Charlie

Jesper Knudsen

Re: Getting MRTG to work
« Reply #12 on: June 06, 2003, 12:07:34 AM »
127.0.0.1 is actually localhost. Try to do a nslookup localhost and see the resulting IP address.

Rgds,
Jesper

anand singh

Re: Getting MRTG to work
« Reply #13 on: September 10, 2003, 12:36:05 PM »
i am posting the file please check it i am getting error of no such file or directory

#!/bin/bash
#This script will create a folder inside the ibay "mrtg" which is named by the first variable. It will create a cfg file inside the /etc/mrtg #folder. It will also add a line to the script "/etc/mrtg/all-ip" so that crontab will run this script which in turn will run mrtg for each #device. The second variable is the IP address of each device to be monitored..This script is best run when "all" the workstations #connected to it are powered up because "cfgmaker" ignores inactive ports when it is run.
#       EX:
#                                                              Var1     Var2
#                                                                 |         |  
#           [root@e-smith /root]# create-mrtg 10001 10.0.0.1

# Create a "workdir" for this device using the first variable
mkdir -p /home/e-smith/files/ibays/mrtg/html/$1

#create the cfg file for this Ip address using the first variable (assumes community string is "public")
perl /usr/bin/cfgmaker public@$2 --global "workdir: /home/e-smith/files/ibays/mrtg/html/$1" --output /etc/mrtg/$1.cfg

#Create an index.html file for this folder using the first variable
perl /usr/bin/indexmaker /etc/mrtg/$1.cfg > /home/e-smith/files/ibays/mrtg/html/$1/index.html

#create an entry in script "all-ip" to run mrtg for each device.  
echo "/usr/bin/mrtg /etc/mrtg/$1.cfg;" >> /etc/mrtg/all-ip  

#Uncommenting the line below will create a "master" index.htm inside the ibay/html directory for all devices.
#Note that this line will create a text file called index.html. This should be edited for correct html syntax.

#echo "
Traffic on ports of Device $1 " >> /home/zserver/files/ibays/mrtg/html/index.html

Jesper Knudsen

Re: Getting MRTG to work
« Reply #14 on: September 10, 2003, 06:17:16 PM »
Hi,

I noticed in the last line:

/home/zserver/files/ibays/mrtg/html/index.html

should properly read:

/home/e-smith/files/ibays/mrtg/html/index.html

Rgds,
Jesper