SrvReport: Tägliche Mail vom Server

Open-Source-Projekte unserer User
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Und wie hast Du das bitteschön wo eingetragen !?
In Deinem Crontab steht zumindest nix!

Mach doch folgendes (geht nur wenn Dein crontab leer ist):

Code: Select all

echo "1-46/15 * * * * /root/srvreport-x.xx/bin/srvreport.pl" >srvreport.ct
crontab srvreport.ct
Dann sollte es funktionieren...

Du kannst auch in "/var/log/messages" nachschauen, ob der crontab ausgeführt wird...
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

verstehe ich nicht ganz sorry.

also ich habe

1-46/15 * * * * /root/srvreport/srvreport-0.60/bin/srvreport.pl

in meine crontab datei eingetragen, so wie es in der install.txt steht.
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Es gibt zwei Möglichkeiten:
1. Du sorgst selber dafür dass der Crontab alle 15 min ausgeführt wird
2. Oder führe das folgende aus:

Code: Select all

echo "1-46/15 * * * * /root/srvreport-x.xx/bin/srvreport.pl" >srvreport.ct 
crontab srvreport.ct
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

hab ich ebend gemacht
mal schaun was nun passiert
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

2 Sachen noch.

1. CPU usage bleibt auch immer 0. Hatte das auch damit zu tun?
2. Ich habe u.a. einen Gameserver laufen der unter home/game/ läuft
also nicht unter einen kunden wie home/www/webX/

Ist es möglich es so einzustellen das er mir einen kleinen report reinschreibt über den Daily Traffic für den Virtuellen Server?
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

thomas.km wrote:1. CPU usage bleibt auch immer 0. Hatte das auch damit zu tun?
Ja.
thomas.km wrote:2. Ich habe u.a. einen Gameserver laufen der unter home/game/ läuft
also nicht unter einen kunden wie home/www/webX/
Ist es möglich es so einzustellen das er mir einen kleinen report reinschreibt über den Daily Traffic für den Virtuellen Server?
Was für einen virtuellen Server !? Wie soll der Traffic gemessen werden !?
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

kajo0011 wrote:Es gibt zwei Möglichkeiten:
1. Du sorgst selber dafür dass der Crontab alle 15 min ausgeführt wird
2. Oder führe das folgende aus:

Code: Select all

echo "1-46/15 * * * * /root/srvreport-x.xx/bin/srvreport.pl" >srvreport.ct 
crontab srvreport.ct
nur mit ich ja nichts falsch mache, das soll nicht in die crontab datei?
einfach nur einmal in der Komandozeile ausführen oder?
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

kajo0011 wrote: Was für einen virtuellen Server !? Wie soll der Traffic gemessen werden !?
Na praktisch wie mit Webalizer auch, der misst ja auch Traffic pro Files.
f.e. wie oft wurde Datei X runtergeladen x File size.

Da aber mein Webalizer nur die reports for /home/www/webX/ macht, misst er es ja nicht bei /home/game/

Und ich möchte ungern den GameServer damit installieren.

Oder müsste ich einen 2 Webalizer nur für dieses Verzeichnis erstellen?
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Wabalizer braucht irgendwelcge logfiles, wo er die Statistik herholen kann! Schreibt Dein Gameserver solche logfiles ?
Wenn ja, dann stellt es kein grosses Problem dar eine Statistik zu erstellen...
Wenn nein (was ich mal vermute), dann bleibt einem meistens nur der Weg über "iptables"...
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

thomas.km wrote:nur mit ich ja nichts falsch mache, das soll nicht in die crontab datei?
einfach nur einmal in der Komandozeile ausführen oder?
Was für eine crontab-Datei !? crontabs werden NIE per Datei editiert!!! sondern nur per "crontab"-Befehl!
Fazit: Alles auf der Kommandozeile ausführen...
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

kajo0011 wrote:
thomas.km wrote:nur mit ich ja nichts falsch mache, das soll nicht in die crontab datei?
einfach nur einmal in der Komandozeile ausführen oder?
Was für eine crontab-Datei !? crontabs werden NIE per Datei editiert!!! sondern nur per "crontab"-Befehl!
Fazit: Alles auf der Kommandozeile ausführen...
na ich meine /etc/crontab

diese datei editiere ich immer mit WINSCP, schon seit 1 1/2 Jahren seit dem ich den Server habe.
Wieso sollte das nicht gehen?

Vielleicht liege ich ja auch völlig falsch
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

kajo0011 wrote:Wabalizer braucht irgendwelcge logfiles, wo er die Statistik herholen kann! Schreibt Dein Gameserver solche logfiles ?
Wenn ja, dann stellt es kein grosses Problem dar eine Statistik zu erstellen...
Wenn nein (was ich mal vermute), dann bleibt einem meistens nur der Weg über "iptables"...
ja logfiles.
Die haben halt ne gewisse größe
Ansonsten kann man halt nur messen wie oft eine Datei hoch/runtergeladen wird
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Es ist Geschmacksache ob man in "/etc/crontab" "rumpfuscht"... eigentlich sollten da nur die Dinge, welches der "crontab" macht drin stehen... alles andere sollten in dem Benutzerspezifischen crontab (via crontab-Befehl) drin sein oder eben in "/etc/cron.*"
Aber da in Linux alles möglich ist, ist es eben in diesem Fall Geschmackssache...

PS: Wenn Du mir das Format der Logfiles für den Game-Server zukommen lässt, kann ich mal schauen ob sich da was machen lässt (bzw. mir einen Link zu einem Beispil oder zur Doku schickst)
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

Hi Jochen

kann ich dich via mail contacten wegen den Logs?
Oder du mich wenn du deine Adresse nicht hier posten willst
TND600@gmx.de
thomas.km
Posts: 364
Joined: 2003-09-14 11:35
Location: Schleswig-Holstein
 

Re: SrvReport: Tägliche Mail vom Server

Post by thomas.km »

Hi Jochen,

hab dir via Mail geantwortet

so far

Grüsse
Thomas
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Jetzt gibt es mal wieder eine neue Version: 0.64

Das wichtigste: Jetzt kann ein Traffic-Report auf basis von "iptables" erstellt werden. Also wer z.B. schon immer wissen wollte welche Programme wieviel Traffic erzeugen, kann dies jetzt rausfinden (auf basis von iptables)!
Defaultmäßsing sind schon ein paar Regeln definiert (www, mail, ssh, ftp, cvs).

Das ganze liefert dann eine Statistik in der Form:

Code: Select all

Target   Bytes IN   Bytes OUT     Summe
www        1.2M       26.3M       27.5M 
ftp       13.6K       16.2K       29.8K 
ssh      231.7K      416.2K      647.9K 
mail      41.8K       55.0K       96.9K 
Andere   907.7K      575.2K        1.4M 
Summe      2.4M       27.4M       29.7M
PS: Wer IAM verwendet, kann den Report sofort verwenden... (das zurücksetzen muss dann entweder über IAM oder SrvReport erfolgen!)

Die neueste Version gibt es bei http://sourceforge.net/project/showfile ... p_id=98398
oder unter http://srvreport.kalmbachnet.de/srvreport-0.64.tgz

Das folgende wurde verbessert:

Code: Select all

07.08.2004 Version 0.64
- mail.css
  - addend entry for "td.iptables_lines"
- srvreport.conf
  - showlines in "IpTablesReport" added
- HTMLHelper.pm:
  - addend entry for "td.iptables_lines"
- IpTablesReport.pm
  - support for config entry 'showlines'
  - small bugfix regadring 'sum'

06.08.2004 Version 0.63
- BaseReport.pm:
  - month names now also may contain 
    "Mär, Mai, Okt, Dez" instead of "Mar, May, Oct, Dec"
- LogReport.pm:
  - new config entry "lineLimit" implemented
    (this affects only the output in html/stdout-files; but the 
    summary entry is correct and an hint will be given if 
    the output was truncated)
- PostfixReport.pm:
  - Support for RejectID NOQUEUE (for Postfix 2.x)
- IpTablesReport.pm: 
  - Reporting of defined chains within "iptables" is now possible!
- iptables_setup
  - added
- INSTALL.TXT
  - Added instructions for iptables_setup
Edit: Jetzt ist es Version 0.64...
kostya
Posts: 89
Joined: 2003-01-22 17:23
 

Re: SrvReport: Tägliche Mail vom Server

Post by kostya »

Danke, funktioniert perfekt meiner Meinung nach. Ich werde jetzt wohl IAM rausschmeissen ;-)
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Danke für die Rückmeldung!
Wer noch Vorschläge hat, wie die default Einstellung für "iptables_setup" aussehen soll, kann dies gerne hier posten.
kostya
Posts: 89
Joined: 2003-01-22 17:23
 

Re: SrvReport: Tägliche Mail vom Server

Post by kostya »

Also noch "defaulter" geht 's ja kaum ;)

Ich persoenlich sehne mich nach den laengst angekuendigten monatlichen/jaehrlichen Reports...
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Kostya wrote:Ich persoenlich sehne mich nach den laengst angekuendigten monatlichen/jaehrlichen Reports...
Ich werde mich gleich an die arbeit machen... :-)

Für welche Report-Typ macht es denn Sinn einen wöchentlichen Report zu erstellen !? Für jeden !?
Das wichtigste ist doch "traffic", oder !?
kostya
Posts: 89
Joined: 2003-01-22 17:23
 

Re: SrvReport: Tägliche Mail vom Server

Post by kostya »

Für welche Report-Typ macht es denn Sinn einen wöchentlichen Report zu erstellen !? Für jeden !?
Das wichtigste ist doch "traffic", oder !?
Mir persoenlich wuerde Report von iptables schon fast ausreichen (dort kann man ja mit den richtigen chains fast alle anderen Reports abdecken).
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

Ich will euch ja nicht mit neuen Versionen überhäufen, aber jetzt gibt es nochmals einen neuen Report: SysinfoReport.
Dieser zeigt (bisher) infos über die gemounteten Dateisysteme und die Speicherauslastung an.
Siehe auch: http://srvreport.kalmbachnet.de/example.html (ganz unten!)
Zu haben wieder unter:
http://sourceforge.net/project/showfile ... p_id=98398
oder http://srvreport.kalmbachnet.de/srvreport-0.65.tgz

Geändert hat sich das folgende:

Code: Select all

09.08.2004 Version 0.65
- LogReport.pm:
  - linebreak in 'getMonthShortString' was wrong
- HTMLHelper.pm:
  - added new column color #FF9999 for table
  - 'TableWithHeadingAndTitle' added
  - added CSS entries (see mail.css)
- IpTablesReport.pm:
  - class for "sum"-line changed from "mailRowSum" to "iptables_sum"
- mail.css
  - added: "td.iptables_sum", "td.sysinfo_hgraph", "tr.sysinfo_sum", "td.table_title"
- srvreport.pl
  - version 0.65
  - added support for "SysinfoReport.pm"
  - only send images via mail which are used
  - added support for returning an array in "getHTMLReport"
- images:
  - green_h.png / orange_h.png added
- BaseReport.pm:
  - prototypes for createing weekly/monthly reports added
  - comments added in 'getHTMLReport' (can now return an array)
- srvreport.conf
  - added default config entries for "SysinfoReport"
- CPUReport.pm
  - return which images are used
- HttpdReport.pm
  - returns now an array which images are used
- TrafficReport.pm
  - returns now an array which images are used
- SysinfoReport.pm
  - NEW!
kostya
Posts: 89
Joined: 2003-01-22 17:23
 

Re: SrvReport: Tägliche Mail vom Server

Post by kostya »

Danke, tut einwandfrei. Zu SystemInfos koennte man auch Uptime des Servers hinzufuehgen...

Eine Option fuers Sortieren des iptables-Reports nach "Target" oder "Bytes Sum" wird sicherlich nicht schaden.
Anonymous
 

Super aber der Tag hat 356 Stunden???Ã?

Post by Anonymous »

Hallo,

ich habe srvreport installiert und es klappt auch soweit. Nur das der Tag bei der Auswertung Traffic Report 346 Stunden hat und bei CPU Usage 347 Stunden hat.

Eine Auswertung könnt Ihr unter http://216.87.215.27/srvreport.html einsehen.

Also warum kommt es zu diesem Fehler habe es schon vorher in einen Thread hier gelesen aber es wurde keine Antwort drauf gegeben.

meine Config sieht so aus:
----
# here you can set your locale
#locale = de


# if set to 1, it will also display the time of the report-generation
ReportWithTime = 1


# with the following you can define the times, when the report will be generated
# it MUST be a time, when the srvreport.pl is run via crontab (- 1:30 and +2:30 min)
# so normally you specify times with xx:01 xx:16 xx:31 xx:46
# (if the crontab is created with "1-46/15 * * * * /root/srvreport-x.xx/bin/srvreport.pl")
#
# you can specify more than one time if your separate it with space
# if nothing is specified 0:01 is taken
#reportTime = 0:01 12:01


# if you want to specify more than one, speparate it with ", "
# like "a@b.c, d@e.f"
# you can also use an "readable" address like:
# "I am your server" <root@domain.org>
MailReport = root@localhost
#optional you can define your own CSS
MailCSS = ./mail.css

# optional you can specify the from-addr
# here you can also specify a "readable" address
# if not, the hostname will be used
#MailFrom = root@domain.org

# optional you can create a file-report in html-format (like the mail)
FileReport = ../web/html/%%YYYY-%%MM-%%DD.html
FileReportImgPath = ../../images/
# optional you can specify here an other CSS-file (only for file-report)
#FileCSS =
# if you change the following to 1, then a file-report will created on every call
FileReportCreateAlways = 0
#FileReportChOwn = web1:ftponly

# optional you can create the report in xml-format, so it can be
# used to generate weekly / monthly / yearly reports
# if you want weekly / monthly / yearly reports this MUST be enabled
xmlReport = ../data/xml/%%YYYY-%%MM-%%DD.xml



# 0: No TEST; normal behavior
# Bit 0 => 1: report-generation with the current day
# Bit 1 => 2: cyclic-call
# Bit 2 => 4: call reportFinished (only available if Bit 0 is also set)
# Bit 3 => 8: output to stdout
# Bit 4 => 16: generate xml-report
# Bit 5 => 32: generate xml-report to stdout
TEST = 0


order = Traffic CPUUsage FTPServer Postfix Warnings LastLogins ChkRootKit

[Traffic]
module = TrafficReport
description = Traffic report
file = /proc/net/dev
interface = eth0:
pattern = %interface %in %o %o %o %o %o %o %o %out

[CPUUsage]
module = CPUReport
description = CPU Usage
file = /usr/bin/uptime |
regex = load average:s+d.dd,s+d.dd,s+(d.dd)

[LastLogins]
module = LogReport
description = Last logins
file = /usr/bin/last |
pattern = %o %o %o %o %time4
cssClass = logreport_left_fixed

[Warnings]
module = LogReport
description = Warnings
file = /var/log/messages
pattern = %time2
cssClass = logreport_left_fixed

#you can also defined your own custom regex
#regex = ^([^s]+)s+([^s]+)s+

#if you have a custom regex and you doe not want the whole file,
# you should specify the keys of the matches
# Known keys are at the moment:
# YEAR MONTH DAY HOUR MIN VHOST BYTES STATE INTERFACE OUT IN
# LogReport only uses YEAR MONTH and DAY
# but this syntax apllies to all modules (Httpd, Postfix CPU Traffic)
regexkeys = MONTH DAY


[FTPLogs]
module = LogReport
description = FTP-Logs
file = /var/log/xferlog
pattern = %o %time1
cssClass = logreport_left_fixed


[WebServer]
module = HttpdReport
description = Web-Server
# variables in "file":
# %%YYYY: Year
# %%MM : Month (always 2 decimals, e.g. "02", "10")
# %%mm : Month (1 or 2 decimals, e.g. "2", "10")
# %%DD : Day (always 2 decimals, e.g. "06", "21")
# %%dd : Day (1 or 2 decimals, e.g. "6", "21")
file = /var/log/srvreport/srvreport_%%YYYY-%%MM-%%DD
wholeFile = 1
# Warning: The following will delete the file after the report is generated!!!
deleteFile = 1
showHTTPStatus = 1

# if the following is defined (or > 0), then the report is limited
# to the specified number of hosts (and the rest is display as "others")
limitHosts = 50

# if the following is > 0 then the hosts will be shown as (external) links
# default is: 1
hostAsLinks = 1

# Example:
# The following is the entry in the apache config-file:
# LogFormat "%v "%{Host}i" %h %t "%r" %>s %b" srvreport
#
# And here is an example of an log-entry:
# jesustotal.de "www.jesustotal.de" 66.196.72.81 [07/Jan/2004:00:07:09 +0100] "GET /impressum.php HTTP/1.0" 200 9719
#
# The following patterns can be used:
# %o: Ignored
# %time1: Time in the form of "May 18 09:05:21 2003"
# %time2: Time in the form of "May 18 09:05:21"
# %time3: Time in the form of "[07/Jan/2004:00:07:09 +0100]" (" +0100" is optional)
# %time4: Time in the form of "Max 18"
# %time5: Time in the form of "2004-01-30 15:34:11"
# %state: State of the request (e.g. 200)
# %bytes: Bytes transfered (e.g. 9719)
# %vhost: Virtual host
#
# If right after the percent (%) a apastrophe (") is found, then this is used as 'encapsulated' character

pattern = %o %"vhost %o %time3 %"o %state %bytes


[FTPServer]
module = HttpdReport
description = FTP-Server
file = /var/log/xferlog
# Sun May 18 09:05:21 2003 2 62.46.204.237 49 /html/images/empty.gif b _ i r web2 ftp 0 * c
pattern = %o %time1 %o %o %bytes %o %o %o %o %o %vhost %o %state %o %o
showHTTPStatus = 0
hostAsLinks = 0


[Postfix]
module = PostfixReport
description = Postfix
file = /var/log/mail.log
pattern = %time2

# the followinf will also show the client-name
# (only relevant in report "Bit 1 => (2)")
showClientName = 1

# showReject can contain 0 (no), 1 (only reject), 2 (complete message)), 3 (complete message encoded)
# be aware that if you have a content-spam-filter and you use 2;
# this report mail might also be rejected!
# (only relevant in report "Bit 1 => (2)")
showReject = 1

# with the following you can specify the report(s) that will be generated from the
# mail-log
# You can combine the values to get multiple statistics
# Bit 0 => 1: Overview
# Bit 1 => 2: Detailed list with all mail-IDs
# Bit 2 => 4: Grouped by "to"
# Bit 3 => 8: Popper-analyze
# Bit 4 => 16: Reject-report
# Default is 1+4+8=13

mailReportType = 1

# if the following is set to > 0, then the "orig_to"-entry will be shown first
# and then the "to" entries.
# if the value is 0, then first the "to" entries will be shown (default)
# (only relevant in report "Bit 2 => (4)")
OrigToFirst = 0


# if the popperAnalyse is set to 1, then the pop3-logins will also shown
# (obosolete; see "mailReportType", value 8)
# popperAnalyze = 1

# with the following you can set the time-interval for popperAnalyse
# default is 5 (minutes), if not set
# if you set the value to 0, all checks will be shown
#popperInterval = 5


[ChkRootKit]
module = LogReport
description = Check for Rootkit
file = /root/chkrootkit-0.43/chkrootkit |
regex = INFECTED
cssClass = logreport_left
----------

Und meine System ist DEBIAN 3.x

Ich habe auch schon mit der Variabel

reportTime = 0:01 12:01

gespielt aber ändert sich nichts der Tag hat Sensationell viele Stunden.

Gruß

Ralf
kajo0011
Userprojekt
Userprojekt
Posts: 382
Joined: 2003-04-15 12:49
 

Re: SrvReport: Tägliche Mail vom Server

Post by kajo0011 »

An der Konfig liegt es nicht.
Es liegt daran, dass Du den cronjob viel öfter läuft als nur alle 15 min!
(Wenn Du es nachrechnest, läuft der cronjob jede Minute!)

Bitte trage den cronjob wie in der INSTALL.TXT-Datei beschrieben in Deine crontab ein!

Code: Select all

1-46/15 * * * * /root/srvreport-x.xx/bin/srvreport.pl
Was liefert den "crontab -l" ?

Trage es bitte mit

Code: Select all

export EDITOR=pico
crontab -e
in Deine crontab ein! (ersetze "pico" durch deinen bevorzugten Editor (z.B. 'vi', 'mcedit', ...))
Post Reply