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 | |
# chkconfig: 2345 99 10 | |
# description: Set Public IP from ElasticIP pool during instance startup | |
# processname: ipassign | |
# Provides: ipassign | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Set Public IP from ElasticIP pool during instance startup |
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
// Convert CIDR to IPv4 range | |
func CIDRRangeToIPv4Range(cidr string) (ipStart string, ipEnd string, err error) { | |
var ip uint32 // ip address | |
var ipS uint32 // Start IP address range | |
var ipE uint32 // End IP address range | |
cidrParts := strings.Split(cidr, "/") |
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 | |
# jnm 20140311 | |
TOTAL_AVAILABLE=$(df /vz | grep '/vz$' | awk '{ print $2 }') | |
vzlist -o ctid,numproc,status,ip,hostname,diskspace -s diskspace | awk ' | |
{ | |
printf $0 "\t" | |
if(NR==1) | |
{ | |
print "in G\tas % 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
<source> | |
type tail | |
format /(?<c_ip>[\w\.]+):(?<c_port>\d+) \[(?<a_date>.+)\] (?<f_end>[\w-]+) (?<b_end>[\w-]+)\/(?<b_server>[\w-]+) (?<tw>\d+)\/(?<tc>\d | |
+)\/(?<tt>\d+) (?<bytes>\d+) (?<t_state>[\w-]+) (?<actconn>\d+)\/(?<feconn>\d+)\/(?<beconn>\d+)\/(?<srv_conn>\d+)\/(?<retries>\d+) (?< | |
srv_queue>\d+)\/(?<backend_queue>\d+)/ | |
time_format %d/%B/%Y:%H:%M:%S | |
path /var/log/haproxy/haproxy_access.log | |
pos_file /opt/fluentd/var/pos/haproxy_access.pos | |
tag haproxy.access | |
</source> |