Skip to content

Instantly share code, notes, and snippets.

View dhiren051's full-sized avatar
🎯
Focusing

DM dhiren051

🎯
Focusing
  • Cypress, CA
View GitHub Profile
@dhiren051
dhiren051 / node_exporter.default
Created September 26, 2019 20:52 — forked from eloo/node_exporter.default
Init.d script for prometheus node exporter
# Set the command-line arguments to pass to the server.
ARGS='-web.listen-address=:9100 -collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"'
# Prometheus-node-exporter supports the following options:
# -collector.diskstats.ignored-devices="^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$": Regexp of devices to ignore for diskstats.
# -collector.filesystem.ignored-mount-points="^/(sys|proc|dev)($|/)": Regexp of mount points to ignore for filesystem collector.
# -collector.ipvs.procfs="/proc": procfs mountpoint.
# -collector.megacli.command="megacli": Command to run megacli.
# -collector.ntp.server="": NTP server to use for ntp collector.
# -collector.textfile.directory="": Directory to read text files with metrics from.
@dhiren051
dhiren051 / Kitchen-CheetSheet.md
Created August 29, 2019 20:35 — forked from arttuladhar/Kitchen-CheetSheet.md
Chef and Knife Commands CheatSheet

Kitchen Commands

kitchen list
kitchen create
kitchen destroy
kitchen login <InstanceName>
@dhiren051
dhiren051 / knife cheat
Created August 21, 2019 20:52 — forked from ipedrazas/knife cheat
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@dhiren051
dhiren051 / readme.md
Created August 21, 2019 19:11 — forked from maxivak/readme.md
Chef. How to run scripts (recipes)

Run Chef scripts locally

There are several options to run recipes:

  • using chef-client with -z option
  • using chef-apply
  • using chef-solo

Before running Chef recipes on the machine, it should be prepared:

@dhiren051
dhiren051 / ambassador_envoy_prometheus_grafana_dashboard.json
Created August 16, 2019 23:42 — forked from psalaberria002/ambassador_envoy_prometheus_grafana_dashboard.json
Grafana dashboard for Ambassador Envoy metrics per destination cluster
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@dhiren051
dhiren051 / alert.sh
Created August 15, 2019 19:31 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@dhiren051
dhiren051 / docker-compose.yml
Created August 13, 2019 22:40 — forked from brunosimioni/docker-compose.yml
Docker Compose to Prometheus, PushGateway and Grafana setup
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}
consul.*.runtime.*
name="consul_runtime"
type="$2"
host="{{ inventory_hostname }}"
consul.runtime.total_gc_pause_ns
name="consul_runtime_total_gc_pause_ns"
type="$2"
host="{{ inventory_hostname }}"

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
brew cask reinstall vagrant
# this might take a long time
vagrant plugin update