This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# HTTP "PING" Program. | |
# Allows someone to check latency to a webserver. | |
# | |
# Code by Brad Lhotsky <brad@divisionbyzero.net> | |
# And Mark Thomas <mark@ackers.net> | |
# | |
# Distributed under the same license as perl itself. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect to Database | |
pgDrv <- dbDriver("PostgreSQL") | |
dbh <- dbConnect(pgDrv, host="", dbname="dnsmonitor", user="dnsmon", password="") | |
# Retrieve Statistics from DB | |
stats <- dbGetQuery(dbh, "select * from packet_timing") | |
# Close the Database Connection and free variables | |
dbDisconnect(dbh) | |
rm(dbh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Library Loading | |
library("RPostgreSQL"); | |
library("car"); | |
library("reshape"); | |
# Connect to Database | |
pgDrv <- dbDriver("PostgreSQL") | |
dbh <- dbConnect(pgDrv, host="localhost", dbname="dnsmonitor", user="dnsmon", password="tooEasy") | |
# Retrieve Statistics from DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Library Loading | |
library("RPostgreSQL"); | |
library("car"); | |
# Connect to Database | |
pgDrv <- dbDriver("PostgreSQL") | |
dbh <- dbConnect(pgDrv, host="localhost", dbname="dnsmonitor", user="dnsmon", password="tooEasy") | |
# Retrieve Statistics from DB | |
stats <- dbGetQuery(dbh, "select client.id, client.ip, sum(queries) as queries, sum(nx) as nx, sum(answers) as answers, sum(errors) as errors, count(distinct day) as days_active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Status; | |
use URI; | |
use Snort::Rule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------# | |
package base; | |
use MooseX::POE; | |
with qw( MooseX::POE::Aliased ); | |
event process => sub { | |
my ($self,$thing) = @_[OBJECT,ARG0]; | |
print "base::process called with $thing\n"; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dns::monitor::plugin::sniffer::log::dest::stdout; | |
use Moose; | |
extends 'dns::monitor::plugin::sniffer::log'; | |
sub write { | |
my ($self,$line) = @_; | |
print $line,"\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BINDIR="/usr/local/sbin" | |
SVNURL="file:///repo/projects/dns-monitor" | |
TARGET="/opt/www/dns-monitor" | |
$BINDIR/svncheckrel $SVNURL $TARGET | |
rc=$?; | |
if [ "$rc" -eq "0" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Assumes /var/log/remote/%HOSTNAME/ configuration for central logger | |
# | |
# collect data | |
time=`date +%s`; | |
distinct=`find /var/log/remote -mmin -60 | cut -d/ -f5| sort -u |wc -l` | |
# send it! | |
echo "syslog.distinct_hosts $distinct $time" | nc graphite 2003 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script to manage syslog storage capacity | |
# Remove anything older than 1 year | |
find /var/log/remote/ -mindepth 2 -mtime +365 -type f -exec rm '{}' \; | |
# Remove empty directories | |
find /var/log/remote/ -type d -empty -exec rmdir '{}' \; |