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
nmap -v -sn -n 192.168.1.0/24 -oG - | awk '/Status: Down/{print $2}' | |
When you use the -v option, Nmap will print the addresses it finds as "down" in addition to the ones that are "up". | |
Instead of -sP, I've substituted the newer spelling -sn, which still accomplishes the same scan, but means "skip the port scan" instead of the misleading "Ping scan" (since the host discovery phase does not necessarily mean an ICMP Echo scan or Ping). | |
The -n option skips reverse DNS lookups, which buys you a bit of time, since you aren't interested in names but just IP addresses. | |
The -oG option tells Nmap to output grepable format, which is easier for awk to process. The argument "-" tells it to send this output to stdout. |
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
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/lmm-kafka-2.ash2.symcpe.net/9092'; echo "Port Check result: $?" | |
for x in $(cat x); do timeout 2 bash -c 'cat < /dev/null > /dev/tcp/'$x'/22' || echo "No SSH to $x"; done |
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
Access http://hypervisor-ip:8085/Snh_SandeshTraceRequest?x=XmppMessageTrace to see if vrouter-agent sent the VM details to the contrail-dns service, for example: | |
2016-02-25 17:14:57.079 XmppTxStream: Sent xmpp message to: <CONTROLLER-IP> Port 8093 Size: 452 Packet: <?xml version="1.0"?> <iq type="set" from="<HYPERVISOR>/dns" to="[email protected]/dns-peer" id="10020"> <dns transid="10020"> <update> <virtual-dns>default-domain:project-name-virtual-DNS</virtual-dns> <zone>project-name.local</zone> <entry> <class>1</class> <type>1</type> <name>vm-hostname</name> <data>10.20.22.5</data> <ttl>86400</ttl> <priority>0</priority> </entry> </update> </dns> </iq> $ controller/src/xmpp/xmpp_connection.cc 211 | |
<?xml version="1.0"?> | |
<iq type="set" from="<HYPERVISOR>/dns" to="[email protected]/dns-peer" id="10020"> | |
<dns transid="10020"> | |
<update> | |
<virtual-dns>default-domain:project-name-virtual-DNS</virtual-dns> |
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
curl -sq http://localhost:8085/Snh_ItfReq? | xmllint --format - |grep "mdata_ip_addr\|vm_name\|<name" |grep -C1 <vmname> |
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
# can we wired in to deploy/update/restart hubot via RESTFUL interface of supervisord | |
# | |
[program:deploy] | |
stdout_logfile=/var/log/supervisor/deploy-hubot-stdout.log | |
stderr_logfile=/var/log/supervisor/deploy-hubot-stderr.log | |
command=/opt/hubot/git_deploy.sh | |
autostart=false | |
[program:hubot] | |
stdout_logfile=/var/log/supervisor/hubot-hubot-stdout.log |
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
nova boot --image <image id> --flavor <flavor id> --availability-zone <az>:<compute> --nic net-id=<network id> <vm name> |
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
echo "deploys.test.myservice:1|c" | nc -w 1 -u graphite.example.com 8125 |
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
(tail -F named.log & P=$! ; sleep 5; kill -9 $P) | wc -l |
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
from vnc_api import vnc_api | |
myVnc = vnc_api.VncApi(api_server_host='127.0.0.1') | |
vms = myVnc.virtual_machines_list(detail=True, fields=['virtual_machine_interface_back_refs', 'virtual_router_back_ref']) | |
# See whats in the first object in the list | |
vms[0].__dict__ |
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
curl -i -X POST -H 'Content-type:application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{ "user":"myUserName","password":"myPassword"},"auth":null,"id":0}' https://zabbix-web.symcpe.net/api_jsonrpc.php |
OlderNewer