<commit_before>#!/bin/bash

source /etc/pingdom.sh

CHECK=$1

[ -z "$PASSWORD" ] && echo "Need to set PASSWORD" && exit 1;
[ -z "$KEY" ] && echo "Need to set KEY" && exit 1;
[ -z "$USER" ] && echo "Need to set USER" && exit 1;

pingdom_down=`curl -s http://isup.me/api.pingdom.com | grep -c "It's not just you"`

if [ $pingdom_down == 1 ]; then
  echo "UNKNOWN: Pingdom API Down"
  exit 3
fi

result=`curl --silent --header "App-Key: ${KEY}" --user ${USER}:${PASSWORD} https://api.pingdom.com/api/2.0/checks/${CHECK}`<commit_msg>Check pingdom directly - if it does not respond in 5 seconds, go unknown<commit_after>#!/bin/bash

source /etc/pingdom.sh

CHECK=$1

[ -z "$PASSWORD" ] && echo "Need to set PASSWORD" && exit 1;
[ -z "$KEY" ] && echo "Need to set KEY" && exit 1;
[ -z "$USER" ] && echo "Need to set USER" && exit 1;

pingdom_down=`curl --connect-timeout 5 -s https://api.pingdom.com/ >/dev/null 2>&1`

if [ $pingdom_down == 28 ]; then
  echo "UNKNOWN: Pingdom API Down"
  exit 3
fi

result=`curl --silent --header "App-Key: ${KEY}" --user ${USER}:${PASSWORD} https://api.pingdom.com/api/2.0/checks/${CHECK}`
{'fraction_non_alphanumeric': 0.2039355992844365, 'fraction_numerical': 0.018783542039355994, 'mean_word_length': 3.4939759036144578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6266045', 'n_tokens_mistral': 454, 'n_tokens_neox': 428, 'n_words': 129}