Nagios/Icinga Plugin to get website time to first byte (TTFB) using libCURL API interface
-
Clone this repository and copy the check_ttfb.pl script to your plugin directory for example
/usr/lib/nagios/plugins/
-
Install (if not already present) the build-dependencies for WWW::Curl - debian example:
apt-get install libcurl4-openssl-dev
-
Install the WWW::Curl perl module
cpan install WWW::Curl
check_ttfb.pl <URL> <TTFB_WARN> <TTFB_CRIT>
URL: HTTP/HTTPS website to perform the check on
TTFB_WARN: Issue a WARNING result after the server need this time to sent the first byte, in seconds
TTFB_CRIT: Issue a CRITICAL result after the server need this time to sent the first byte, in seconds
check_ttfb.pl http://example.com 1.2 4.1
This check will issue WARNING if the ttfb is longer than 1.2 seconds and issue CRITICAL if it's longer than 4 seconds.
Assuming this command
check_ttfb.pl http://example.com 0.6 1.5
creates this as output if you use the given nagios-perfdata in tools like pnp4nagios