This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# Interact with the Icinga-Web API. | |
# Please set the environment variable. | |
# $ export ICINGA_URL="http://<icinga-url>" | |
# $ export ICINGA_AUTH_KEY="<icinga auth key>" | |
# | |
# Commands: | |
# hubot icinga start all <hosts> - Turn on the notification of the specified hosts of host and services | |
# hubot icinga stop all <hosts> - Turn off the notification of the specified hosts of host and services | |
# hubot icinga start host <hosts> - Turn on the notification of the specified hosts of host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::Redisextend; | |
use CloudForecast::Data -base; | |
use CloudForecast::TinyClient; | |
=head1 NAME | |
CloudForecast::Data::Redisextend - redis resource monitor | |
=head1 SYNOPSIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::WinBasic; | |
use CloudForecast::Data -base; | |
=head1 NAME | |
CloudForecast::Data::WinBasic - Basic for Windows | |
=head1 DESCRIPTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::WinDisk; | |
use CloudForecast::Data -base; | |
=head1 NAME | |
CloudForecast::Data::WinDisk - Disk resource for Windows | |
=head1 DESCRIPTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::WinDiskio; | |
use CloudForecast::Data -base; | |
=head1 NAME | |
CloudForecast::Data::WinDiskio - Disk IO resource for Windows | |
=head1 DESCRIPTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::Gpu; | |
use CloudForecast::Data -base; | |
use JSON qw/encode_json decode_json/; | |
rrds map { [ $_, 'GAUGE' ] } qw/cpu memory/; | |
graphs 'cpu' => 'GPU Usage [%]'; | |
graphs 'memory' => 'GPU Memory Usage [%]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
tmp=/tmp/nvidia_tmp.txt | |
/usr/bin/nvidia-smi -q -d UTILIZATION > $tmp | |
cpu=$(cat $tmp | awk '/Gpu/ {print $3}') | |
memory=$(cat $tmp | awk '/Memory.*:/ {print $3}') | |
echo "{\"cpu\":${cpu}, \"memory\":${memory}}" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Icinga disable notification checker | |
# Please install jq package before use. | |
# e.g. yum install jq | |
from_address="notification@hogehoge.com" | |
to_address=${1:-"foo@bar.example.com"} | |
set_body() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
region="ap-northeast-1" | |
error_batches=$(node queryBatches.js $region error) | |
i=0 | |
while : | |
do | |
error_batch=$(echo $error_batches | jq -r .[$i]) | |
if [ $? -ne 0 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import boto3, os, json, calendar | |
from base64 import b64decode | |
from datetime import datetime, timedelta | |
from urllib2 import Request, urlopen | |
os.environ['TZ'] = 'Asia/Tokyo' | |
mackerel_url = "https://mackerel.io/api/v0/services/%s/tsdb" | |
encrypted_mackerel_api_key = "<ENCRYPTED_API_KEY>" |