Skip to content

Instantly share code, notes, and snippets.

View chandra-goka's full-sized avatar
🌍

CHANDRA SHEKHAR GOKA chandra-goka

🌍
View GitHub Profile
#!/usr/bin/env bash
# Error codes
AGENT_NOT_INSTALLED=101
AGENT_NOT_ACTIVE=102
function get_datadog_status() {
if command -v systemctl &>/dev/null; then
agent_status=$(systemctl status datadog-agent.service 2>/dev/null)
if [ $? -ne 0 ]; then
#!/usr/bin/env bash
function get_datadog_status() {
if command -v systemctl &>/dev/null; then
agent_status=$(systemctl status datadog-agent.service 2>/dev/null)
if [ $? -ne 0 ]; then
echo "Datadog agent not installed"
return 1
fi
agent_health=$(echo "$agent_status" | awk '/Active:/ {print $2}')
package com.otp;
import java.util.*;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.sqs.SqsClient;
import software.amazon.awssdk.services.sqs.model.*;
public class SQS_Example {
public static void main(String[] args) {
{
"domain-c91": {
"_mor": {
"type": "ClusterComputeResource",
"value": "domain-c91"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
This file has been truncated, but you can view the full file.
{
"host-88": {
"_mor": {
"type": "HostSystem",
"value": "host-88"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
This file has been truncated, but you can view the full file.
{
"vm-213": {
"_mor": {
"type": "VirtualMachine",
"value": "vm-213"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
{
"datastore-264": {
"_mor": {
"type": "Datastore",
"value": "datastore-264"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
{
"datacenter-42": {
"_mor": {
"type": "Datacenter",
"value": "datacenter-42"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
{
"group-d1": {
"_mor": {
"type": "Folder",
"value": "group-d1"
},
"availableField": [
{
"key": 1,
"name": "com.rackspace.rpcv.goss",
"script": "Set-ExecutionPolicy Bypass -Scope CurrentUser -Force\n[System.Net.ServicePointManager]::
SecurityProtocol = @(\n [System.Net.SecurityProtocolType]::Tls;,\n
[System.Net.SecurityProtocolType]::Tls12;\n)\n
$ScriptResponse = Invoke-WebRequest \"https://vmc-ssm-agent-install.s3-us-west-2.amazonaws.com/ssm-agent-install.ps1\"
-UseBasicParsing\n$Script = [System.Text.Encoding]::UTF8.GetString($ScriptResponse.Content)\n$ScriptBlock = [Scriptblock]::Create($Script)\n
Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList
($args + @(\"wqdWaDWEe6/KVn6vNxNl\", \"49a31a45-d9b6-4d89-a727-1f9d537646c0\", \"eu-west-2\"))"
execution:: 767cf564-41f5-41e0-846e-7f3058c7ac21