mirror of
https://github.com/manuelkasper/AS-Stats.git
synced 2025-02-20 11:44:12 +08:00
+ CentOS start script
* fix link names with upper-case characters
This commit is contained in:
parent
a497c5fc9e
commit
970329a116
4
README
4
README
@ -5,7 +5,9 @@ by Manuel Kasper, Monzoon Networks AG <mkasper@monzoon.net>
|
||||
|
||||
Changes
|
||||
-------
|
||||
v1.2 Allow inbound/outbound in graphs to be swapped (via option
|
||||
v1.2 Support for sFlow (through sflow-asstatd.pl); fix for link names
|
||||
with upper-case characters
|
||||
Allow inbound/outbound in graphs to be swapped (via option
|
||||
in www/func.inc)
|
||||
|
||||
v1.1 Fix for a potential race condition surrounding $childrunning
|
||||
|
80
contrib/centos/as-stats
Executable file
80
contrib/centos/as-stats
Executable file
@ -0,0 +1,80 @@
|
||||
#! /bin/bash
|
||||
#
|
||||
# as-stats - Start/Stop the as-stats NetFlow collector.
|
||||
#
|
||||
# chkconfig: 2345 90 10
|
||||
# description: as-stats is a program that collects NetFlow data
|
||||
# and process it in order to show the different
|
||||
# sourced / destinated IP traffic AS.
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
DAEMON=netflow-asstatd.pl
|
||||
RRDDIR=/data/as-stats/rrd
|
||||
KNOWNLINKS=/data/as-stats/etc/netflow-knownlinks
|
||||
|
||||
prog="as-stats"
|
||||
|
||||
start() {
|
||||
echo -n $"Starting $prog: "
|
||||
|
||||
# start daemon
|
||||
daemon /data/as-stats/bin/$DAEMON $RRDDIR $KNOWNLINKS >> /data/as-stats/output.log &
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL = 0 ] && touch /var/lock/subsys/as-stats
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
|
||||
# stop daemon
|
||||
killproc $DAEMON
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/as-stats
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
echo -n $"Reloading $prog daemon configuration: "
|
||||
killproc $DAEMON -HUP
|
||||
RETVAL=$?
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
rhstatus() {
|
||||
status $DAEMON
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
reload)
|
||||
reload
|
||||
;;
|
||||
status)
|
||||
rhstatus
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|reload|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
|
@ -8,7 +8,7 @@
|
||||
require_once('func.inc');
|
||||
|
||||
$as = $_GET['as'];
|
||||
if (!preg_match("/^[0-9a-z]+$/", $as))
|
||||
if (!preg_match("/^[0-9a-zA-Z]+$/", $as))
|
||||
die("Invalid AS");
|
||||
|
||||
header("Content-Type: image/png");
|
||||
|
@ -14,7 +14,7 @@ if ($_GET['numtop'] && $_GET['numtop'] <= 50)
|
||||
$ascolors = array("D41C0E", "E45605", "FECF12", "2FA11C", "19BB7C", "0A4484", "0A7484", "4CB4C4", "971928", "1f348c");
|
||||
|
||||
$link = $_GET['link'];
|
||||
if (!preg_match("/^[a-z0-9]+$/", $link))
|
||||
if (!preg_match("/^[0-9a-zA-Z]+$/", $link))
|
||||
die("Invalid link");
|
||||
|
||||
/* first step: walk the data for all ASes to determine the top 5 for the given link */
|
||||
|
Loading…
x
Reference in New Issue
Block a user