User Tools

Site Tools


rb:tophitsonwebsite

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rb:tophitsonwebsite [18/02/2020 10:37] – created - external edit 127.0.0.1rb:tophitsonwebsite [30/07/2025 09:54] (current) andrew
Line 1: Line 1:
-===== Check for top ipaddresses hitting Expose =====+===== Check for top ipaddresses hitting website ===== 
 + 
 +Nagios check for too many requests from one ip address. 
 +This may give a false positive if users are behind a proxy server with one internet facing ipaddress for many users. 
 +Note the excluded list of ipaddresses. This should probably not be embedded in the code. v2 will sort this. Sometime.... 
  
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
-#Written Andrew Stringer, 01/08/2014 onwards +#Written A, 01/08/2014 onwards 
-#Check for excessive hits on Expose website+#Check for excessive hits on website
  
 STATE_OK=0 STATE_OK=0
Line 22: Line 27:
  
  
-HITS=`echo ${IPADDRESS}|awk '{ print $1 }'` +HITS=$(echo ${IPADDRESS}|awk '{ print $1 }') 
-SOURCE=`echo ${IPADDRESS}|awk '{ print $2 }'`+SOURCE=$(echo ${IPADDRESS}|awk '{ print $2 }')
 if [[ $HITS -ge 1800 ]] if [[ $HITS -ge 1800 ]]
 then then
rb/tophitsonwebsite.txt · Last modified: by andrew

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki