Skip to content

Instantly share code, notes, and snippets.

View haidlir's full-sized avatar
🏠
Working from home

Haidlir Naqvi haidlir

🏠
Working from home
View GitHub Profile
@haidlir
haidlir / blackbox.yml
Last active November 22, 2018 15:03
API Monitoring - Blackbox Exporter
modules:
http-2xx-get-token-9f057:
prober: http
timeout: 15s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2"]
valid_status_codes: [200]
method: GET
headers:
@haidlir
haidlir / prometheus.yml
Last active November 22, 2018 15:05
API Monitoring - Prometheus
scrape_configs:
- job_name: 'exporter-001-get'
scrape_interval: 1m
metrics_path: /probe
params:
module: [http-2xx-get-token-9f057]
static_configs:
- targets:
- http://api.startup-example.id/v1/profiles/me
@haidlir
haidlir / docker-compose.yaml
Created November 22, 2018 15:09
API Monitoring - Docker Compose
version: "2.1"
networks:
api-monitoring:
volumes:
prom-storage:
graf-storage:
services:
@haidlir
haidlir / main-dashboard.json
Created November 23, 2018 07:46
API Monitoring - Main Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@haidlir
haidlir / alerting.json
Created November 23, 2018 08:02
API Monitoring - Alerting
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@haidlir
haidlir / docker-compose.yaml
Last active November 23, 2018 08:49
API Monitoring - Final Docker Compose
version: "2.1"
networks:
api-monitoring:
volumes:
prom-storage:
graf-storage:
services:
@haidlir
haidlir / notificator.yaml
Created November 23, 2018 08:10
API Monitoring - Notificator
notificator:
- name: bot-startup-example
type: telegram-bot
configuration:
bot_token: <telegram-bot-token>
recipient_id:
- <telegram-room-id-1>
- <telegram-room-id-2>
http_server_port: :4444
package main
import (
"encoding/json"
"net/http"
"log"
"strconv"
"github.com/gorilla/mux"
)
OID Keterangan
.1.3.6.1.2.1.1.1.0 sysDescr atau Deskripsi dari Perangkat; biasanya digunakan untuk mengetahui vendor atau tipe dari perangkat
.1.3.6.1.2.1.1.3.0| ysUptime atau Uptime dari Perangkat; biasanya digunakan untuk mengetahui sudah berapa lama perangkat tersebut hidup.
.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.2 agentSwitchCpuProcessMemAvailable atau total memori yang dimiliki oleh perangkat jaringan Dell
.1.3.6.1.4.1.9.10.85.7 cInetCidrRouteTable atau tabel rute yang ada di perangkat jaringan Cisco
package main
import (
"encoding/json"
"net/http"
"log"
"strconv"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"