diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 7d9140441..0f7b7a784 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash echo " [.. .. [.. [.. .. [... [..[.. [..[....... " echo " [.. [.. [.. [.. [.. [.. [..[. [.. [..[. [.. [...[.. [.. " @@ -9,193 +9,227 @@ echo " [.. [.. [.. [..[.... [. [..[.. [..[.. [. ..[.. [..[.. echo " [.. .. [.... [.. [.. .. [.. [..[.. [..[.. " - -KUBERNETES_POLLER_CONFIG_MAP_NAME="poller-config" -SC4SNMP_POLLER_DIR="./sc4snmp/" -SC4SNMP_TRAP_DIR="./sc4snmp/" - -# Change this as needed to adjust with your flavor of k8s wrapper! i.e. kubectl k3s minikube -alias k='k3s kubectl' -# alias k='minikube kubectl' - - -kubernetes_undeploy_all() { - - for conf in "$@"; do - k delete -f "${conf}" - +realpath() { + OURPWD=$PWD + cd "$(dirname "$1")" + LINK=$(readlink "$(basename "$1")") + while [ "$LINK" ]; do + cd "$(dirname "$LINK")" + LINK=$(readlink "$(basename "$1")") done - - # Hard Clean up - k delete deployment sc4-snmp-traps - k delete service/sc4-snmp-traps-service - - k delete deployment mib-server - k delete service/mib-server-service - - # k -n default delete pod,svc,deployment --all --grace-period 0 --force --v=6 && sleep 3 && kubectl get pods - k -n default delete pod,svc,deployment --all --grace-period 0 --force && sleep 3 && kubectl get pods -} - -download_poller_config_file() { - token=$1 - poller_config_raw_file="raw.githubusercontent.com/splunk/splunk-connect-for-snmp-poller/main/config.yaml" - full_poller_config_raw_file="https://${token}@${poller_config_raw_file}" - poller_config_file_name="poller-config.yaml" - if ! curl --fail -s "${full_poller_config_raw_file}" -o "${poller_config_file_name}" ; then - echo "Cannot access ${poller_config_raw_file}" - exit 1 - fi - - echo "${poller_config_file_name}" -} - -kubernetes_poller_deploy_or_update_config() { - poller_config_file=$1 - kubernetes_configmap_name=$2 - k apply configmap "${kubernetes_configmap_name}" --from-file="${poller_config_file}" --dry-run=client -o yaml \ - | k apply -f - - k get configmap "${kubernetes_configmap_name}" -o yaml + REALPATH="$PWD/$(basename "$1")" + cd "$OURPWD" + echo "$REALPATH" } -kubernetes_create_or_replace_docker_secret() { - server=$1 - username=$2 - authentication_token=$3 - email=$4 - secret_name=$5 - - k delete secret "${secret_name}" - k create secret docker-registry "${secret_name}" \ - --docker-server="${server}" \ - --docker-username="${username}" \ - --docker-password="${authentication_token}" \ - --docker-email="${email}" -} - -kubernetes_create_or_replace_hec_secret() { - echo "== kubernetes_create_or_replace_hec_secret ==" - url=$1 - hec_token=$2 - secret_name=$3 - - k delete secret "${secret_name}" - k create secret generic remote-splunk \ - --from-literal=SPLUNK_HEC_URL="${url}" \ - --from-literal=SPLUNK_HEC_TLS_SKIP_VERIFY=true \ - --from-literal=SPLUNK_HEC_TOKEN="${hec_token}" - k get secret -} - -clean_up() { - echo "== clean_up ==" - for temporary_file in "$@"; do - rm -rf "${temporary_file}" +HCMD=helm +if ! command -v helm &> /dev/null +then + if command -v microk8s.helm3 &> /dev/null + then + HCMD=microk8s.helm3 + else + echo "helm3 could not be found" + exit + fi +fi + +KCMD=kubectl +if ! command -v kubectl &> /dev/null +then + if command -v microk8s.kubectl &> /dev/null + then + KCMD=microk8s.kubectl + else + echo "kubectl could not be found" + exit + fi +fi + +# CUSTER_NAME=${CUSTER_NAME:=splunk-connect} +# NAMESPACE=${NAMESPACE:=default} + +if [ ! -n "$MODE" ]; then + read -p 'Select MODE one of splunk,sim,both: ' MODE + case "${MODE}" in + splunk) + echo "MODE Splunk" + ;; + sim) + echo "MODE SIM" + ;; + both) + echo "MODE Both" + ;; + *) + echo "MODE invalid" + exit 1 + ;; + esac +fi + +if [ "$MODE" == "splunk" ] || [ "$MODE" == "both" ]; +then + + while [ ! -n "$HOST" ] + do + read -p 'FQDN of Splunk HEC Inputs: ' HOST + + resolvedIP=$(nslookup "$HOST" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs) + if [[ -z "$resolvedIP" ]]; then + echo "$HOST" lookup failure + unset HOST + fi done -} - -undeploy_poller() { - rabbitmq_deployment="deployment.apps/$(yq -r .metadata.name $SC4SNMP_POLLER_DIR\rq-deployment.yaml)" - echo "Removing deployment for ${rabbitmq_deployment}" - k delete "${rabbitmq_deployment}" - - rabbitmq_service="service/$(yq -r .metadata.name $SC4SNMP_POLLER_DIR/rq-service.yaml)" - echo "Removing service ${rabbitmq_service}" - k delete "${rabbitmq_service}" -} - -kubernetes_deploy_rabbitmq() { - k apply -f $SC4SNMP_POLLER_DIR/rq-deployment.yaml - k apply -f $SC4SNMP_POLLER_DIR/rq-service.yaml -} - -kubernetes_deploy_mongo() { - k apply -f $SC4SNMP_POLLER_DIR/mongo-deployment.yaml - k apply -f $SC4SNMP_POLLER_DIR/mongo-service.yaml -} - -kubernetes_deploy_poller() { - k apply -f $SC4SNMP_POLLER_DIR/scheduler-config.yaml - k apply -f $SC4SNMP_POLLER_DIR/scheduler-deployment.yaml - k apply -f $SC4SNMP_POLLER_DIR/worker-deployment.yaml -} -kubernetes_deploy_mibserver() { - k apply -f $SC4SNMP_POLLER_DIR/mib-server-deployment.yaml - k apply -f $SC4SNMP_POLLER_DIR/mib-server-service.yaml -} - -kubernetes_deploy_snmpsim() { - k apply -f $SC4SNMP_POLLER_DIR/sim-deployment.yaml -} - -kubernetes_deploy_traps() { - k apply -f $SC4SNMP_TRAP_DIR/traps-server-config.yaml - k apply -f $SC4SNMP_TRAP_DIR/traps-deployment.yaml - k apply -f $SC4SNMP_TRAP_DIR/traps-service.yaml -} - -kubernetes_deploy_otel() { - k apply -f $SC4SNMP_TRAP_DIR/otel-config.yaml - k apply -f $SC4SNMP_TRAP_DIR/otel-deployment.yaml - k apply -f $SC4SNMP_TRAP_DIR/otel-service.yaml -} - - - - -health_check() { - echo "== health_check ==" - k get pods - k get service - k get deployment - k get secret -} - - -# ----------------------------------------------------------------------------- -# MAIN -# ----------------------------------------------------------------------------- - -kubernetes_undeploy_all $SC4SNMP_POLLER_DIR/worker-deployment.yaml $SC4SNMP_POLLER_DIR/scheduler-deployment.yaml \ - $SC4SNMP_POLLER_DIR/mongo-deployment.yaml $SC4SNMP_POLLER_DIR/mongo-service.yaml \ - $SC4SNMP_POLLER_DIR/rq-deployment.yaml $SC4SNMP_POLLER_DIR/rq-service.yaml \ - $SC4SNMP_POLLER_DIR/mib-server-deployment.yaml $SC4SNMP_POLLER_DIR/mib-server-service.yaml \ - $SC4SNMP_TRAP_DIR/traps-deployment.yaml $SC4SNMP_TRAP_DIR/traps-service.yaml \ - $SC4SNMP_TRAP_DIR/otel-deployment.yaml $SC4SNMP_TRAP_DIR/otel-deployment.yaml - - -health_check -sleep 5 - -github_username="${USER}" -github_email="${github_username}@splunk.com" -echo "Please type your person access github token:" -read -r token + while [ ! -n "$PROTO" ] + do + read -p 'PROTO of Splunk HEC Inputs http or https (default): ' PROTO + PROTO=${PROTO:-https} + done -poller_config_file=$(download_poller_config_file "${token}") + while [ ! -n "$PORT" ] + do + read -p 'PORT of Splunk HEC Inputs 443 (default): ' PROTO + PORT=${PORT:-443} + done + URI_PORT=":$PORT" + + if [ "$PROTO" = "https" ]; then + while [ ! -n "$INSECURE_SSL" ] + do + read -p 'INSECURE_SSL allow true or false (default): ' INSECURE_SSL + INSECURE_SSL=${INSECURE_SSL:-false} + if [ "$INSECURE_SSL" == "true" ] || [ "$INSECURE_SSL" == "false" ]; + then + echo "" + else + unset INSECURE_SSL + fi + done + fi -kubernetes_poller_deploy_or_update_config "${poller_config_file}" "${KUBERNETES_POLLER_CONFIG_MAP_NAME}" -# TODO: try to get the secret name with yq directly from scheduler-deployment.yaml. For now I am -# getting a syntax error when trying to access a list, not sure why. -kubernetes_create_or_replace_docker_secret "https://ghcr.io/v2/splunk" ${github_username} ${token} ${github_email} "regcred" -kubernetes_create_or_replace_hec_secret "https://54.145.16.74:8088/services/collector" "a43a5b69-1813-44a8-b9df-3b05ca84883d" "remote-splunk" + if [ "$INSECURE_SSL" == "true" ]; + then + CURL_SSL=-k + fi + while [ ! -n "$TOKEN" ] + do + read -p 'TOKEN of Splunk HEC Inputs: ' TOKEN + done - echo "== kubernetes_deploy_snmpsim ==" + echo testing HEC url + curl -f $CURL_SSL $PROTO://$HOST$URI_PORT/services/collector -H "Authorization: Splunk $TOKEN" -d '{"event": "test" }' + if [ "$?" != "0" ]; + then + echo Splunk URL test failed + exit 1 + fi + echo "" + while [ ! -n "$EVENTS_INDEX" ] + do + echo "" + read -p 'EVENTS_INDEX for splunk em_events (default): ' EVENTS_INDEX + EVENTS_INDEX=${EVENTS_INDEX:-em_events} + echo testing HEC url with index $EVENTS_INDEX + curl -f $CURL_SSL $PROTO://$HOST$URI_PORT/services/collector -H "Authorization: Splunk $TOKEN" -d "{\"index\": \"$EVENTS_INDEX\", \"event\": \"test\" }" + if [ "$?" != "0" ]; + then + unset EVENTS_INDEX + fi + done -kubernetes_deploy_snmpsim + while [ ! -n "$METRICS_INDEX" ] + do + echo "" + read -p 'METRICS_INDEX for splunk (default): ' METRICS_INDEX + METRICS_INDEX=${METRICS_INDEX:-em_metrics} + echo testing HEC url with index $METRICS_INDEX + curl -f $CURL_SSL $PROTO://$HOST$URI_PORT/services/collector -H "Authorization: Splunk $TOKEN" -d "{\"index\": \"$METRICS_INDEX\", \"event\": \"metric\" }" + if [ "$?" != "0" ]; + then + unset METRICS_INDEX + fi + done - echo "== deploy remaining services ==" -kubernetes_deploy_rabbitmq -kubernetes_deploy_mongo -kubernetes_deploy_mibserver -kubernetes_deploy_otel -sleep 3 -kubernetes_deploy_traps -kubernetes_deploy_poller + while [ ! -n "$META_INDEX" ] + do + echo "" + read -p 'META_INDEX for splunk default: ' META_INDEX + META_INDEX=${META_INDEX:-em_logs} + echo testing HEC url with index $META_INDEX + curl -f $CURL_SSL $PROTO://$HOST$URI_PORT/services/collector -H "Authorization: Splunk $TOKEN" -d "{\"index\": \"$META_INDEX\", \"event\": \"test\" }" + if [ "$?" != "0" ]; + then + unset META_INDEX + fi + done + while [ ! -n "$CLUSTER_NAME" ] + do + read -p "CLUSTER_NAME of deployment $(hostname) (default): " CLUSTER_NAME + CLUSTER_NAME=${CLUSTER_NAME:=$(hostname)} + done -clean_up "${poller_config_file}" -sleep 5 -health_check + $KCMD create ns sck 2>/dev/null || true + + $HCMD repo add splunk https://splunk.github.io/splunk-connect-for-kubernetes/ >/dev/null + $HCMD uninstall -n sck sck + cat deploy/sck/sck_145.yaml \ + | sed "s/##INSECURE_SSL##/${INSECURE_SSL}/g" \ + | sed "s/##PROTO##/${PROTO}/g" \ + | sed "s/##PORT##/${PORT}/g" \ + | sed "s/##HOST##/${HOST}/g" \ + | sed "s/##TOKEN##/${TOKEN}/g" \ + | sed "s/##EVENTS_INDEX##/${EVENTS_INDEX}/g" \ + | sed "s/##METRICS_INDEX##/${METRICS_INDEX}/g" \ + | sed "s/##META_INDEX##/${META_INDEX}/g" \ + | sed "s/##CUSTER_NAME##/${CUSTER_NAME}/g" \ + | sed "s/##NAMESPACE##/${NAMESPACE}/g" \ + | $HCMD -n sck install sck -f - splunk/splunk-connect-for-kubernetes +fi #end splunk or both + +$KCMD delete ns sc4snmp --wait=true 2>/dev/null +$KCMD create ns sc4snmp 2>/dev/null || true + +if [ "$MODE" == "both" ]; +then + $KCMD -n sc4snmp create secret generic remote-splunk \ + --from-literal=SPLUNK_HEC_URL=$PROTO://$HOST$URI_PORT/services/collector \ + --from-literal=SPLUNK_HEC_TLS_SKIP_VERIFY=$INSECURE_SSL \ + --from-literal=SPLUNK_HEC_TOKEN=$TOKEN \ + --from-literal=SIGNALFX_TOKEN=$SIMTOKEN \ + --from-literal=SIGNALFX_REALM=$SIMREALM +fi +if [ "$MODE" == "splunk" ]; +then + $KCMD -n sc4snmp create secret generic remote-splunk \ + --from-literal=SPLUNK_HEC_URL=$PROTO://$HOST$URI_PORT/services/collector \ + --from-literal=SPLUNK_HEC_TLS_SKIP_VERIFY=$INSECURE_SSL \ + --from-literal=SPLUNK_HEC_TOKEN=$TOKEN +fi +if [ "$MODE" == "sim" ]; +then + $KCMD -n sc4snmp create secret generic remote-splunk \ + --from-literal=SIGNALFX_TOKEN=$SIMTOKEN \ + --from-literal=SIGNALFX_REALM=$SIMREALM +fi + + + +$KCMD -n sc4snmp create -f deploy/sc4snmp/ftr 2>/dev/null + +while [ ! -n "$SHAREDIP" ] +do + read -p 'SHAREDIP for HA installations this is in addition to the member addresses for single instance this is the host ip: ' SHAREDIP + +done +cat deploy/sc4snmp/external/traps-service.yaml \ + | sed "s/##SHAREDIP##/${SHAREDIP}/g" \ + | $KCMD -n sc4snmp apply -f - + +$KCMD -n sc4snmp apply -f deploy/sc4snmp/internal + +echo "" +echo done diff --git a/deploy/sc4snmp/traps-service.yaml b/deploy/sc4snmp/external/traps-service.yaml similarity index 70% rename from deploy/sc4snmp/traps-service.yaml rename to deploy/sc4snmp/external/traps-service.yaml index 8816bbcdb..b2a7280e2 100644 --- a/deploy/sc4snmp/traps-service.yaml +++ b/deploy/sc4snmp/external/traps-service.yaml @@ -2,14 +2,15 @@ apiVersion: v1 kind: Service metadata: name: sc4-snmp-traps + annotations: + metallb.universe.tf/allow-shared-ip: "true" spec: externalTrafficPolicy: Local type: LoadBalancer - # loadBalancerIP: replace-me + loadBalancerIP: ##SHAREDIP## ports: - port: 162 targetPort: 2162 protocol: UDP selector: app: sc4-snmp-traps - diff --git a/deploy/sc4snmp/scheduler-config.yaml b/deploy/sc4snmp/ftr/scheduler-config.yaml similarity index 100% rename from deploy/sc4snmp/scheduler-config.yaml rename to deploy/sc4snmp/ftr/scheduler-config.yaml diff --git a/deploy/sc4snmp/scheduler-inventory.yaml b/deploy/sc4snmp/ftr/scheduler-inventory.yaml similarity index 100% rename from deploy/sc4snmp/scheduler-inventory.yaml rename to deploy/sc4snmp/ftr/scheduler-inventory.yaml diff --git a/deploy/sc4snmp/traps-server-config.yaml b/deploy/sc4snmp/ftr/traps-server-config.yaml similarity index 100% rename from deploy/sc4snmp/traps-server-config.yaml rename to deploy/sc4snmp/ftr/traps-server-config.yaml diff --git a/deploy/sc4snmp/mib-server-deployment.yaml b/deploy/sc4snmp/internal/mib-server-deployment.yaml similarity index 100% rename from deploy/sc4snmp/mib-server-deployment.yaml rename to deploy/sc4snmp/internal/mib-server-deployment.yaml diff --git a/deploy/sc4snmp/mib-server-service.yaml b/deploy/sc4snmp/internal/mib-server-service.yaml similarity index 100% rename from deploy/sc4snmp/mib-server-service.yaml rename to deploy/sc4snmp/internal/mib-server-service.yaml diff --git a/deploy/sc4snmp/mongo-deployment.yaml b/deploy/sc4snmp/internal/mongo-deployment.yaml similarity index 100% rename from deploy/sc4snmp/mongo-deployment.yaml rename to deploy/sc4snmp/internal/mongo-deployment.yaml diff --git a/deploy/sc4snmp/mongo-service.yaml b/deploy/sc4snmp/internal/mongo-service.yaml similarity index 100% rename from deploy/sc4snmp/mongo-service.yaml rename to deploy/sc4snmp/internal/mongo-service.yaml diff --git a/deploy/sc4snmp/otel-config.yaml b/deploy/sc4snmp/internal/otel-config.yaml similarity index 100% rename from deploy/sc4snmp/otel-config.yaml rename to deploy/sc4snmp/internal/otel-config.yaml diff --git a/deploy/sc4snmp/otel-deployment.yaml b/deploy/sc4snmp/internal/otel-deployment.yaml similarity index 100% rename from deploy/sc4snmp/otel-deployment.yaml rename to deploy/sc4snmp/internal/otel-deployment.yaml diff --git a/deploy/sc4snmp/otel-service.yaml b/deploy/sc4snmp/internal/otel-service.yaml similarity index 100% rename from deploy/sc4snmp/otel-service.yaml rename to deploy/sc4snmp/internal/otel-service.yaml diff --git a/deploy/sc4snmp/rq-deployment.yaml b/deploy/sc4snmp/internal/rq-deployment.yaml similarity index 100% rename from deploy/sc4snmp/rq-deployment.yaml rename to deploy/sc4snmp/internal/rq-deployment.yaml diff --git a/deploy/sc4snmp/rq-service.yaml b/deploy/sc4snmp/internal/rq-service.yaml similarity index 100% rename from deploy/sc4snmp/rq-service.yaml rename to deploy/sc4snmp/internal/rq-service.yaml diff --git a/deploy/sc4snmp/scheduler-deployment.yaml b/deploy/sc4snmp/internal/scheduler-deployment.yaml similarity index 100% rename from deploy/sc4snmp/scheduler-deployment.yaml rename to deploy/sc4snmp/internal/scheduler-deployment.yaml diff --git a/deploy/sc4snmp/traps-deployment.yaml b/deploy/sc4snmp/internal/traps-deployment.yaml similarity index 100% rename from deploy/sc4snmp/traps-deployment.yaml rename to deploy/sc4snmp/internal/traps-deployment.yaml diff --git a/deploy/sc4snmp/worker-deployment.yaml b/deploy/sc4snmp/internal/worker-deployment.yaml similarity index 100% rename from deploy/sc4snmp/worker-deployment.yaml rename to deploy/sc4snmp/internal/worker-deployment.yaml diff --git a/docs/source/gettingstarted.rst b/docs/source/gettingstarted.rst index c0054a13e..b411a97f4 100644 --- a/docs/source/gettingstarted.rst +++ b/docs/source/gettingstarted.rst @@ -23,7 +23,7 @@ Requirements (Splunk Enterprise/Enterprise Cloud) 1.3 em_logs (event type) 3. Create or obtain a new Splunk HTTP Event Collector token and the correct https endpoint. 4. Verify the token using `curl `_ Note: The endpoint must use a publicly trusted certificate authority. -5. The IP address to be used for SNMP Traps. Note if HA deployment will be used the IP must be in addition to the managment inteface of each cluster memember. +5. The SHARED IP address to be used for SNMP Traps. Note Simple and POC deployments will use the same IP as the host server if HA deployment will be used the IP must be in addition to the managment inteface of each cluster memember. 6. Obtain the ip address of an internal DNS server able to resolve the Splunk Endpoint Requirements (Splunk Infrastructure Monitoring) @@ -43,11 +43,10 @@ The following setup instructions are validated for release 1.20x but are subject 1. Install MicroK8s ``sudo snap install microk8s --classic`` 2. Check completion status ``sudo microk8s status --wait-ready`` 3. Install optional modules ``sudo microk8s enable dns: metallb helm3`` -4. Alias kubectl ``alias kubectl="microk8s kubectl"`` -4. Alias kubectl ``alias heml3="microk8s helm3"`` -5. Grant access to the kubectl config file ``sudo usermod -a -G microk8s $USER`` -6. Grant access to the kubectl config file ``sudo chown -f -R $USER ~/.kube`` -7. Refresh credentials ``su - $USER`` +4. Grant access to the kubectl config file ``sudo usermod -a -G microk8s $USER`` +5. Grant access to the kubectl config file ``sudo chown -f -R $USER ~/.kube`` +6. Refresh credentials ``su - $USER`` + Get current deployment scripts =================================================== @@ -57,63 +56,46 @@ Get current deployment scripts git clone https://github.com/splunk/splunk-connect-for-snmp.git cd splunk-connect-for-snmp -Monitor MicroK8s (Requires Splunk Enterprise/Cloud) -=================================================== - -1. Ensure Requirements are meet above -2. Add the Helm repository ``microk8s.helm3 repo add splunk https://splunk.github.io/splunk-connect-for-kubernetes/`` -3. Deploy Splunk Connect for Kubernetes ``HOST=foo.domain.com PORT=8088 EVENTS_INDEX=em_events METRICS_INDEX=em_metrics META_INDEX=em_logs PROTO=https INSECURE_SSL=false deploy/sck/deploy_sck.sh`` -4. Wait 30 seconds -5. Confirm the following search returns results ``| mcatalog values(metric_name) where index=em_metrics AND metric_name=kube* AND host=`` -Setup Secrets +Deploy SC4SNMP Interactive =================================================== -Execute the following commands, use the correct values for your env: - -* Setup URL and token secrets (you can remove SignalFX secrets when SignalFX exporter is not configured) - .. code-block:: bash - kubectl create secret generic remote-splunk \ - --from-literal=SPLUNK_HEC_URL=https://hec-input.fqdn.com:8088/services/collector \ - --from-literal=SPLUNK_HEC_TLS_SKIP_VERIFY=true \ - --from-literal=SPLUNK_HEC_TOKEN=splunkhectoken \ - --from-literal=SIGNALFX_TOKEN=signalfxtoken \ - --from-literal=SIGNALFX_REALM=signalfxrealm + ./deploy/deploy.sh -Deploy SC4SNMP +Deploy SC4SNMP non-interactive =================================================== -* Apply the manifests, replace the ip ``10.0.101.22`` with the shared IP noted above - .. code-block:: bash - for f in deploy/sc4snmp/*.yaml ; do cat $f | sed 's/loadBalancerIP: replace-me/loadBalancerIP: 10.0.101.22/' | microk8s.kubectl apply -f - ; done + MODE=splunk \ + PROTO=https \ + INSECURE_SSL=true \ + HOST=i-08c221389a3b9899a.ec2.splunkit.io \ + PORT=8088 \ + TOKEN=450a69af-16a9-4f87-9628-c26f04ad3785 \ + METRICS_INDEX=em_metrics \ + EVENTS_INDEX=em_events \ + META_INDEX=em_logs \ + CLUSTER_NAME=foo \ + ./deploy/deploy.sh -* Confirm deployment using ``kubectl get pods`` - -.. code-block:: bash - - NAME READY STATUS RESTARTS AGE - mongo-65484dd8b4-fnzw4 1/1 Running 1 28h - sc4-snmp-traps-55bf6ff8f6-wwbnc 1/1 Running 1 28h - mib-server-6bdd68795c-cpvpl 1/1 Running 1 28h - rabbitmq-65bc7457dd-wtj4m 1/1 Running 1 28h - sc4-snmp-scheduler-5c6db68ff4-bnpn9 1/1 Running 1 28h - sc4-snmp-otel-5bb6d85555-2cwb7 1/1 Running 1 28h - sc4-snmp-worker-6f45794df7-qxl2m 1/1 Running 1 28h - -* Confirm deployment using ``kubectl get svc`` confirm the value of external-ip in the row below matches IP used above +* Confirm deployment using ``kubectl get svc -n sc4snmp`` confirm the value of external-ip in the row below matches IP used above .. code-block:: bash NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE sc4-snmp-traps LoadBalancer 10.152.183.134 10.202.6.253 162:32652/UDP 28h +Test Monioring with SCK (Requires Splunk) +=================================================== + +Confirm the following search returns results ``| mcatalog values(metric_name) where index=em_metrics AND metric_name=kube* AND host=`` + Test SNMP Traps =================================================== @@ -146,16 +128,25 @@ with following columns: *. frequency in seconds (how often SNMP connector should ask agent for data) .. code-block:: bash - vi deploy/sc4snmp/scheduler-config.yaml + cp deploy/sc4snmp/ftr/scheduler-inventory.yaml ~/scheduler-inventory.yaml + vi ~/scheduler-inventory.yaml # Remove the comment from line 2 and correct the ip and community value - kubectl apply -f deploy/sc4snmp/scheduler-config.yaml + kubectl apply -n sc4snmp -f ~/scheduler-inventory.yaml -* Search splunk, one event per trap command with the host value of the test machine ip will be found +Test Poller +=================================================== + +Search splunk, one event per trap command with the host value of the test machine ip will be found .. code-block:: bash + index=* sourcetype="sc4snmp:meta" SNMPv2_MIB__sysLocation_0="*" | dedup host +.. code-block:: bash + + | mcatalog values(metric_name) where index=em_metrics AND metric_name=sc4snmp* AND host= + Maintain ===================================================