Created
November 19, 2011 01:51
-
-
Save reyjrar/1378303 to your computer and use it in GitHub Desktop.
log the number of distinct hosts communicating with syslog in the past 60 minutes
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment