#!/bin/bash

if [ "$(curl  --max-time 20 -H "$(cat /usr/lib64/nagios/plugins/headers.txt)" 'http://api.cbill.kvdc.net/api/SyncData/GetSyncData?lastSyncDate&offset=0&count=13' 2>&1 | grep -o "Operation timed out")" ]; then
	echo "Data not fetched" | mail -s "KCCL SQL issue" rooshi@cliffsupport.com,divya@cliffsupport.com,saravana@cliffsupport.com,veena@syntrio.in,nishita@syntrio.in
	echo "CRITICAL: Data not fetched in cbill.kvdc.net";
	exit 2;
else
	echo "OK: Data fetched"
	exit 0;
fi
