This commit is contained in:
root
2025-11-07 11:31:06 +00:00
commit 2859f93882
407 changed files with 99769 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
ScriptAlias /smokeping/smokeping.cgi /usr/lib/cgi-bin/smokeping.cgi
Alias /smokeping /usr/share/smokeping/www
<Directory "/usr/share/smokeping/www">
Options FollowSymLinks
Require all granted
DirectoryIndex smokeping.cgi
</Directory>

16
debian/smokeping/etc/default/smokeping vendored Normal file
View File

@@ -0,0 +1,16 @@
# /etc/default/smokeping: Startup configuration for smokeping(1)
#
# select master or slave mode
MODE=master
# in master mode, the rest of the configuration is in
# /etc/smokeping/config
#
# in slave mode, uncomment and set the following variables too
# see smokeping(1)
#
# Mandatory configuration
# MASTER_URL=http://somewhere/cgi-bin/smokeping.cgi
# SHARED_SECRET=/etc/smokeping/slavesecrets.conf
#
# Optional configuration
# SLAVE_NAME=myslave

196
debian/smokeping/etc/init.d/smokeping vendored Executable file
View File

@@ -0,0 +1,196 @@
#!/bin/sh
#
# /etc/init.d/smokeping
#
### BEGIN INIT INFO
# Provides: smokeping
# Required-Start: $syslog $network $remote_fs
# Should-Start: sshd apache
# Required-Stop: $syslog $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the smokeping latency logging system daemon
# Description: SmokePing is a latency logging and graphing system
# that consists of a daemon process which organizes
# the latency measurements and a CGI which presents
# the graphs. This script is used to start or stop
# the daemon.
### END INIT INFO
#
set -e
# Source LSB init functions
. /lib/lsb/init-functions
DAEMON=/usr/sbin/smokeping
NAME=smokeping
DESC="latency logger daemon"
CONFIG=/etc/smokeping/config
PIDFILE=/var/run/smokeping/$NAME.pid
DAEMON_USER=smokeping
DEFAULTS=/etc/default/smokeping
MODE=master
DAEMON_ARGS="--config=$CONFIG"
# LC_ALL prevents resetting LC_NUMERIC which in turn interferes
# with Smokeping internal regexps matching floating point numbers
unset LC_ALL
# Check whether the binary is still present:
test -f "$DAEMON" || exit 0
# source defaults for master vs. slave mode
if [ -f "$DEFAULTS" ]
then
. "$DEFAULTS"
fi
check_slave() {
if [ "$MODE" != "slave" ]
then
return
fi
if [ -z "$SHARED_SECRET" ]
then
log_progress_msg "(missing \$SHARED_SECRET setting)"
log_end_msg 6 # program is not configured
exit 6
fi
if [ ! -r "$SHARED_SECRET" ]
then
log_progress_msg "(invalid \$SHARED_SECRET setting)"
log_end_msg 2 # invalid or excess argument(s)
exit 2
fi
if [ -z "$MASTER_URL" ]
then
log_progress_msg "(missing \$MASTER_URL setting)"
log_end_msg 6 # program is not configured
exit 6
fi
DAEMON_ARGS="$DAEMON_ARGS --master-url $MASTER_URL --shared-secret $SHARED_SECRET"
if [ -n "$SLAVE_NAME" ]
then
DAEMON_ARGS="$DAEMON_ARGS --slave-name $SLAVE_NAME"
fi
DAEMON_ARGS="$DAEMON_ARGS --cache-dir /var/lib/smokeping"
DAEMON_ARGS="$DAEMON_ARGS --pid-dir /var/run/smokeping"
}
check_config () {
echo "Checking smokeping configuration file syntax..."
# Check whether the configuration file is available
if [ ! -r "$CONFIG" ] && [ "$MODE" = "master" ]
then
log_progress_msg "($CONFIG does not exist)"
log_end_msg 6 # program is not configured
exit 6
fi
if [ ! -d /var/run/smokeping ]; then
mkdir /var/run/smokeping
chown ${DAEMON_USER}.root /var/run/smokeping
chmod 0755 /var/run/smokeping
fi
${DAEMON} --config=${CONFIG} --check || exit 6
}
case "$1" in
start)
check_config
log_daemon_msg "Starting $DESC" $NAME
check_slave
set +e
pidofproc -p "$PIDFILE" "$DAEMON" > /dev/null
STATUS=$?
set -e
if [ "$STATUS" = 0 ]
then
log_progress_msg "already running"
log_end_msg $STATUS
exit $STATUS
fi
set +e
start-stop-daemon --start --quiet --exec $DAEMON --oknodo \
--chuid $DAEMON_USER --pidfile $PIDFILE \
-- $DAEMON_ARGS \
| logger -p daemon.notice -t $NAME
STATUS=$?
set -e
log_end_msg $STATUS
exit $STATUS
;;
stop)
log_daemon_msg "Shutting down $DESC" $NAME
set +e
start-stop-daemon --oknodo --stop --retry 3 --quiet --pidfile $PIDFILE --user $DAEMON_USER --signal 15
STATUS=$?
set -e
log_end_msg $STATUS
exit $STATUS
;;
restart)
# Restart service (if running) or start service
$0 stop
$0 start
;;
reload|force-reload)
check_config
log_action_begin_msg "Reloading $DESC configuration"
set +e
$DAEMON --reload $DAEMON_ARGS | logger -p daemon.notice -t smokeping
STATUS=$?
set -e
if [ "$STATUS" = 0 ]
then
log_action_end_msg 0 "If the CGI has problems reloading, see README.Debian."
else
log_action_end_msg $STATUS
fi
exit $STATUS
;;
check)
check_config
;;
status)
log_daemon_msg "Checking $DESC status" $NAME
# Use pidofproc to check the status of the service,
# pidofproc returns the exit status code of 0 when it the process is
# running.
# LSB defined exit status codes for status:
# 0 program is running or service is OK
# 1 program is dead and /var/run pid file exists
# 2 program is dead and /var/lock lock file exists
# 3 program is not running
# 4 program or service status is unknown
# 5-199 reserved (5-99 LSB, 100-149 distribution, 150-199 applications)
set +e
pidofproc -p "$PIDFILE" "$DAEMON" > /dev/null
STATUS=$?
log_progress_msg "(status $STATUS)"
log_end_msg 0
set -e
exit $STATUS
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload|reload}"
exit 1
;;
esac

View File

@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gQSFA8qQC+y8wAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAABd0lEQVQoz5WSy07CQBSGTzuF6Y1buQSiCYSgYli7MC54AZc+gC/CE7kzrPQBjDsNIdF4I8oCwr1gO51OOy4aAbGS+K/OTM6X85/5R2g0GvAfSesHjPyj3LyasrIKxch3fXHiSN0Fvv4wbCZuAobsnld7Scw4wIhEhiSCEc/IbgqzZicTMuG0NEpi9jhRLzuZOUXBJRK4ITOfr1yIy6oYIwDQ7KSX3QDgcWFgR9ZtrwCLIQAoJ8j2pVG9Xg8qDsJe0j5MWcW4g5FvMUQ8cRvQXeAplXY0mlfpftI+zpu1tBURed/CHhdCAADoWfiml3gxlYUraZKXVdxKwq6lPx8mqvM97QcQaEalV1O57cffTGVXdzKKa8isNdI3l/6tzly+eM4BQDlOQl4pVEECLDSHUowUNCqsdedVelYZAEB7rIUkfVKYHaQs4okTIjEuJKJePMoCY1fvRghwN9R9gIJKs4orCtxm6Gmq3I/01lDnob+1PdbWR/+lL5mtm+fskIeBAAAAAElFTkSuQmCC" rel="icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmokePing Latency Page for <##title##></title>
<link rel="stylesheet" type="text/css" href="css/smokeping-print.css" media="print">
<link rel="stylesheet" type="text/css" href="css/smokeping-screen.css" media="screen">
<script>
window.options = {
step: <##step##>
}
</script>
</head>
<body id="body">
<div class="sidebar" id="sidebar">
<div class="sidebar-header">
<div class="logo">
<##smokelogo##>
</div>
</div>
<div class="sidebar-menu">
<br><br>
<ul class="menu">
<li class="menuitem"><a class="menulink" href="/"><B>HOME</B></a></li></ul>
<##menu##>
<div class="logo">
<##rrdlogo##>
</div>
</div>
</div>
<div class="navbar">
<div class="navbar-menu"><a id="menu-button" href="#">Toggle Menu</a></div>
<div class="navbar-refresh"><a id="refresh-button" href="#">Auto Refresh</a></div>
<div class="navbar-user"><div class="icon-person"></div><##authuser##></div>
</div>
<div class="main">
<h1><##title##></h1>
<h2><##remark##></h2>
<div class="overview">
<##overview##>
</div>
<div class="details">
<##body##>
</div>
</div>
<hr>
<div class="footer">
<p class="footer-right"><small>Running on <##smokeping##> by <##author##></small></p>
<p><small>Maintained by <a href="mailto:<##contact##>"><##owner##></a></small></p>
</div>
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous/scriptaculous.js?load=builder,effects,dragdrop" type="text/javascript"></script>
<script src="js/cropper/cropper.js" type="text/javascript"></script>
<script src="js/smokeping.js" type="text/javascript"></script>
</body>
</html>

7
debian/smokeping/etc/smokeping/config vendored Normal file
View File

@@ -0,0 +1,7 @@
@include /etc/smokeping/config.d/General
@include /etc/smokeping/config.d/Alerts
@include /etc/smokeping/config.d/Database
@include /etc/smokeping/config.d/Presentation
@include /etc/smokeping/config.d/Probes
@include /etc/smokeping/config.d/Slaves
@include /etc/smokeping/config.d/Targets

View File

@@ -0,0 +1,10 @@
*** Alerts ***
to = alertee@address.somewhere
from = smokealert@company.xy
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row

View File

@@ -0,0 +1,15 @@
*** Database ***
step = 300
pings = 20
# consfn mrhb steps total
AVERAGE 0.5 1 28800
AVERAGE 0.5 12 9600
MIN 0.5 12 9600
MAX 0.5 12 9600
AVERAGE 0.5 144 2400
MAX 0.5 144 2400
MIN 0.5 144 2400

View File

@@ -0,0 +1,16 @@
*** General ***
owner = Peter Random
contact = some@address.nowhere
mailhost = my.mail.host
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
cgiurl = http://some.url/smokeping.cgi
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no
@include /etc/smokeping/config.d/pathnames

View File

@@ -0,0 +1,60 @@
*** Presentation ***
template = /usr/etc/basepage.html.dist
htmltitle = yes
graphborders = no
# If enabled, treat all filter menu queries as literal strings instead of regex
literalsearch = no
+ charts
menu = Charts
title = The most interesting destinations
++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds
+ overview
width = 600
height = 50
range = 10h
+ detail
width = 600
height = 200
unison_tolerance = 2
"Last 3 Hours" 3h
"Last 30 Hours" 30h
"Last 10 Days" 10d
"Last 360 Days" 360d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location

View File

@@ -0,0 +1,6 @@
*** Probes ***
+ FPing
binary = /usr/sbin/fping

View File

@@ -0,0 +1,10 @@
*** Slaves ***
secrets=/usr/etc/smokeping_secrets.dist
+boomer
display_name=boomer
color=0000ff
+slave2
display_name=another
color=00ff00

View File

@@ -0,0 +1,26 @@
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.
+ Test
menu= Targets
#parents = owner:/Test/James location:/
++ James
menu = James
title =James
alerts = someloss
slaves = boomer slave2
host = james.address
++ MultiHost
menu = Multihost
title = James and James as seen from Boomer
host = /Test/James /Test/James~boomer

View File

@@ -0,0 +1,8 @@
sendmail = /usr/sbin/sendmail
imgcache = /usr/cache
imgurl = cache
datadir = /usr/data
piddir = /usr/var
smokemail = /usr/etc/smokemail.dist
tmail = /usr/etc/tmail.dist
dyndir = /var/lib/smokeping/__cgi

View File

@@ -0,0 +1,65 @@
From: <##FROM##>
To: <##TO##>
Subject: SmokePing Agent
Hi,
Please execute the attached Perl Script on your computer. It will register
your IP with SmokePing. You have to rerun this script at least every time
your IP changes. You can run the script as often as you want.
The script is written in Perl. If you don't have Perl available on your
system, you must have a Windows Box. You can easily fix this problem by
downloading ActivePerl from www.activestate.com
As soon as you have run the SmokePing Agent, the SmokePing server will
start monitoring your host. Check out:
<##URL##>?target=<##PATH##>
Cheers
<##OWNER##>
------------8<------------------------
#!/usr/bin/perl -w
my $url = '<##URL##>';
my $path = '<##PATH##>';
my $secret = '<##SECRET##>';
use strict;
use IO::Socket;
my $post="target=${path}&secret=${secret}";
my $clen=length $post;
$url =~ m|http://([^/]+)(/.+)|;
my $host = $1;
my $script = $2;
my $remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
exit 0 unless $remote;
$remote->autoflush(1);
print $remote <<"REQUEST";
POST $script HTTP/1.0\r
User-Agent: smokeping-agent/1.0\r
Host: ${host}:80\r
Pragma: no-cache\r
Content-Length: ${clen}\r
Content-Type: application/x-www-form-urlencoded\r
\r
${post}\r
REQUEST
my $head = 1;
while (<$remote>) {
/^\s*$/ && do {$head=0;next};
print unless $head;
}
close $remote;
exit;
------------8<------------------------

View File

@@ -0,0 +1,3 @@
host1:mysecret
host2:yoursecret
boomer:lkasdf93uhhfdfddf

132
debian/smokeping/etc/smokeping/tmail vendored Normal file
View File

@@ -0,0 +1,132 @@
MIME-Version: 1.0
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<TITLE>IT System Availability Report</TITLE>
<STYLE TYPE ='text/css'>
.appHeader {
color: #000000;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding-left: 10px;
padding-top: 7px;
border-width: 10px;
border-color: #FFFFFF;
border-style:none;
border-left-width: 10px;
border-left-color: #8CAAE6;
border-left-style: solid;
}
.Head {
color: Turquoise;
background-color: White;
font-family: Verdana, Helvetica, San-Serif;
font-size: 20px;
font-weight: bold;
text-decoration: underline;
}
.SubSubHead {
color: RoyalBlue;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
font-weight: bold;
}
.SubHead {
color: RoyalBlue;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 13px;
font-weight: bold;
text-decoration: underline;
}
.SubDetail {
color: Black;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
background-color: CornSilk;
}
.Up99 {
color: DarkGreen;
text-align: Center;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
font-weight: bold;
}
.Up95 {
color: DarkBlue;
text-align: Center;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
font-weight: bold;
}
.Up90 {
color: Orange;
text-align: Center;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
font-weight: bold;
}
.UpNo {
color: Red;
text-align: Center;
background-color: CornSilk;
font-family: Verdana, Helvetica, San-Serif;
font-size: 11px;
font-weight: bold;
}
.Display-Block { display:'block' }
.Display-None { display:'none' }
</STYLE>
</head>
<body onLoad=
"Day.style.display='none';
Week.style.display='none';
Month.style.display='none';
Quarter.style.display='none';" >
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr><td bgcolor='#FFFFFF'>
<img border='0' src='http://www.xxxx.com/docs/TEMPLATE/204/xxxx_logo.gif' alt='Put your logo here'></a></td><td class='Head'>XXXX IT System Availability</td></tr>
</table>
<P>
<P>
<HR width='80%'>
<P>
<##SUMMARY##>
<p>
<CENTER>
<table width='60%' border='1' cellspacing='0' cellpadding='0'>
<tr>
<td bgcolor='CornSilk' onMouseOver="Quarter.style.display='block'"
onMouseOut="Quarter.style.display='none'">Quarterly Detail</td>
<td bgcolor='CornSilk' onMouseOver="Month.style.display='block'"
onMouseOut="Month.style.display='none'">Monthly Detail</td>
<td bgcolor='CornSilk' onMouseOver="Week.style.display='block'"
onMouseOut="Week.style.display='none'">Weekly Detail</td>
<td bgcolor='CornSilk' onMouseOver="Day.style.display='block'"
onMouseOut="Day.style.display='none'">Daily Detail</td>
</tr>
</table>
</CENTER>
<p>
<div id="Day">
<##DAYDETAIL##>
</div>
<p>
<div id="Week">
<##WEEKDETAIL##>
</div>
<p>
<div id="Month">
<##MONTHDETAIL##>
</div>
<p>
<div id=Quarter>
<##QUARTERDETAIL##>
</div>
</html></body>