Skip to content

Instantly share code, notes, and snippets.

@ianblenke
ianblenke / es_pri_allocate_unassigned.md
Last active November 18, 2021 00:14
elasticsearch trying to allocate a primary shard which is disabled

Allow routing allocations:

curl -XPUT localhost:9200/_cluster/settings -d '{
                "transient" : {
                    "cluster.routing.allocation.enable" : "all"
                }
        }'
@ashrithr
ashrithr / readme.md
Last active December 7, 2022 01:47
Installing ELK on a single machine

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
import SoftLayer.API
from pprint import pprint as pp
apiUsername = 'set me'
apiKey = 'set me'
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
<?php
/**
* Retrieve metric data for a single server.
*
* This example shows how to use the SoftLayer API to retrieve metric data for
* Advanced Monitoring on a single hardware or virtual guest server instance.
*
* We will call the SoftLayer API to retrieve the monitoring agents,
* configuration template, and configuration values for a server instance.
* Then we will demonstrate how to find definitions that you have enabled for
from pprint import pprint as pp
import SoftLayer
client = SoftLayer.Client()
mgr = SoftLayer.CCIManager(client)
serverId = 1234
mask = ('mask[monitoringAgents[id,name,statusName]]')
server = mgr.get_instance(serverId, mask=mask)
pp(server)
@ryanrhanson
ryanrhanson / acctAlarms.py
Last active August 29, 2015 13:56
Retrieve all active nimsoft alarms on account
import SoftLayer
apiUser = (api username)
apiKey = (api key)
client=SoftLayer.Client(username=apiUser,api_key=apiKey)
acctalarms=client['Account'].getActiveAlarms()
for alarm in acctalarms:
hostname = client['Monitoring_Robot'].getObject(id=alarm['robotId'],mask="mask[softwareComponent[virtualGuest,hardware]]")
@larryli
larryli / cgi.go
Last active March 5, 2024 17:14
golang net/http/cgi example
// go build -ldflags "-s -w" -o index.cgi cgi.go
package main
import (
"fmt"
"net/http"
"net/http/cgi"
)
<?php
/**
* Add new configuration for a monitoring agent.
*
* This example shows how to use the SoftLayer API to add new configuration for a monitoring agent for the hardware or virtual guest
* server instance.
*
* @license <http://sldn.softlayer.com/wiki/index.php/License>
* @author SoftLayer Technologies, Inc. <sldn@softlayer.com>
*/
@underscorephil
underscorephil / deleteMonitoringNotification.py
Created October 10, 2013 20:31
Delete a notification object
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)