#!/bin/sh

# Proof of concept snort plugin written by Edward Bjarte Fjellskål.

if [ "$1" = "config" ]; then
        echo 'graph_title Snort Drop Rate'
        echo 'graph_args --base 1000 -l 0'
        echo 'graph_vlabel % percent'
        echo 'graph_scale no'
        echo 'droprate.label % percent'
	# To tell Nagios 
        echo 'droprate.warning 1'
        echo 'droprate.critical 2'
        echo 'graph_category Snort'

        exit 0
fi

echo -n "droprate.value "
echo $( tail -n1 /your/path/to/snort.stats| awk -F, '{ print $2 }')
