Docs » SignalFx Smart Agent commands reference

SignalFx Smart Agent commands reference 🔗

This topic provides commonly used commands for the Smart Agent.

Note

To see commonly used commands for Splunk Distribution of OpenTelemetry Collector, see Splunk Distribution of OpenTelemetry Collector commands reference.

The standard ports for the Smart Agent are 9080 and 8095. The default configuration is stored in /etc/signalfx/agent.yaml.

Note

When you deploy the agent as a DaemonSet on Kubernetes clusters, the agent configuration is managed by the ConfigMap of the agent.

The following table lists all the commands and their usage in context of the Smart Agent. Click a command for a more detailed description and syntax examples.

Command

Usage

helm delete

Delete the Smart Agent Helm chart repository

helm install

Deploy the Smart Agent Helm chart repository

helm repo add

Add the Smart Agent Helm chart repository

helm repo update

Update the Smart Agent Helm chart repository

journalctl

Check the agent logs on the host

kubectl config

Modify Kubernetes configurations

kubectl create

Create a Kubernetes resource

kubectl delete

Delete a Kubernetes resource

kubectl describe

Check Kubernetes system configurations

kubectl edit

Edit a Kubernetes resource

kubectl exec

Execute a command in a Kubernetes container

kubectl get

Display one or many resources running on Kubernetes

kubectl logs

Check logs in a Kubernetes container

restart

Restart the agent on the host

start

Start the agent on the host

status

Check the status of the agent on the host

status endpoints

Check the endpoints set on the agent

stop

Stop the agent on the host

tap-dps

Tail metric data points being sent to the host

helm delete 🔗

Description 🔗

Delete the Smart Agent Helm chart repository.

Syntax 🔗

helm delete signalfx-agent

helm install 🔗

Description 🔗

Deploy the Smart Agent Helm chart repository.

Syntax 🔗

helm install \
--set signalFxAccessToken=$ACCESS_TOKEN \
--set clusterName=<MY-CLUSTER> \
--set kubeletAPI.url=https://localhost:10250 \
--set signalFxRealm=$REALM  \
--set traceEndpointUrl=https://ingest.$REALM.signalfx.com/v2/trace \
--set gatherDockerMetrics=false \
signalfx-agent signalfx/signalfx-agent \
-f ~/workshop/k3s/values.yaml

helm repo add 🔗

Description 🔗

Add the Smart Agent Helm chart repository.

Syntax 🔗

helm repo add signalfx https://dl.signalfx.com/helm-repo

# Use these two commands together to add and update the repository at the same time
helm repo add signalfx https://dl.signalfx.com/helm-repo && helm repo update

helm repo update 🔗

Description 🔗

Update the Smart Agent Helm chart repository.

Syntax 🔗

helm repo update https://dl.signalfx.com/helm-repo

journalctl 🔗

Description 🔗

Check the agent logs on the host.

Syntax 🔗

journalctl -u signalfx-agent | tail -f
tail -f /var/log/signalfx-agent.log

Optional arguments 🔗

Argument

Description

-u

Show messages for the specified systemd unit UNIT (such as a service unit), or for any of the units matched by PATTERN

tail -f

Display the last part of a file. The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the input. The -f option is ignored if the standard input is a pipe, but not if it is a FIFO.

kubectl config 🔗

Description 🔗

Modify Kubernetes configurations using subcommands. See the Kubectl Reference Documentation for a full list of subcommands and optional arguments.

Syntax 🔗

kubectl config [subcommand]

# Examples

# Show kubeconfig settings
kubectl config view

# Save namespace for all subsequent kubectl commands in context
kubectl config set-context --current --namespace=ggckad-s2

# Get the password for the e2e user
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

# Display the first user
kubectl config view -o jsonpath='{.users[].name}'

# Get a list of users
kubectl config view -o jsonpath='{.users[*].name}'

# Display list of contexts
kubectl config get-contexts

# Display the current-context
kubectl config current-context

# Set the default context to my-cluster-name
kubectl config use-context my-cluster-name

# Add a new user to your kubeconfig that supports basic authorization
kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword

# Set a context utilizing a specific username and namespace
kubectl config set-context gce --user=cluster-admin --namespace=foo \ && kubectl config use-context gce

kubectl create 🔗

Description 🔗

Create a resource from a file. Accepted file formats are JSON and YAML. See the Kubectl Reference Documentation for a full list of subcommands and optional arguments.

Syntax 🔗

sudo kubectl create -f <file-name>

# Examples

# Use the subcommand configmap to create a ConfigMap from a source file
sudo kubectl create configmap <map-name> --from-file=<file path>

Optional arguments 🔗

Argument

Description

-f

The source file to create a resource

--from-file

Path to the source file to create a ConfigMap

<map-name>

Name of the ConfigMap

kubectl delete 🔗

Description 🔗

Delete a resource from a source file. See the Kubectl Reference Documentation for a full list of subcommands and optional arguments.

Syntax 🔗

sudo kubectl delete -f <file-name>

Optional arguments 🔗

Argument

Description

-f

The source file to delete a resource

kubectl describe 🔗

Description 🔗

Check Kubernetes system configurations.

Syntax 🔗

kubectl describe -n <namepsace> pod <pod-name>

Optional arguments 🔗

Argument

Description

-n

Namespace to check the configurations

pod

Pod to check the configurations

kubectl edit 🔗

Description 🔗

Edit a resource running on a Kubernetes container.

Syntax 🔗

kubectl edit cm <name>
kubectl edit ds <name>

Optional arguments 🔗

Argument

Description

cm

Specify the item you want to modify is a ConfigMap

ds

Specify the item you want to modify is a DaemonSet

<name>

Name of the resource you want to modify

kubectl exec 🔗

Description 🔗

Execute a command in a Kubernetes container.

Syntax 🔗

kubectl exec <signalfx-agent-PODNAME> -- signalfx-agent status

Optional arguments 🔗

Argument

Description

<signalfx-agent-PODNAME>

Name of the pod

-- signalfx-agent status

Check the status of the agent

kubectl get 🔗

Description 🔗

Display one or many resources running on Kubernetes.

Syntax 🔗

kubectl get pods -n <namespace>
kubectl get configmap
kubectl get ds

Optional arguments 🔗

Argument

Description

configmap

Display the ConfigMap

ds

Display the DaemonSet

-n

Namespace

pods

List all pods in process status output format

kubectl logs 🔗

Description 🔗

Check logs in a Kubernetes container.

Syntax 🔗

sudo kubectl logs <pod-name | type/name> -l <label> -f -c <container-name>

# Examples

# Return snapshot logs from pod nginx with only one container
kubectl logs nginx

# Return snapshot logs from pod nginx with multiple containers
kubectl logs nginx --all-containers=true

# Return snapshot logs from all containers in pods defined by label app=nginx
kubectl logs -l app=nginx --all-containers=true

# Return snapshot of previous terminated ruby container logs from pod web-1
kubectl logs web-1 -p -c ruby

# Begin streaming the logs of the ruby container in pod web-1
kubectl logs web-1 -f -c ruby

# Begin streaming the logs from all containers in pods defined by label app=nginx
kubectl logs -f -l app=nginx --all-containers=true

# Display only the most recent 20 lines of output in pod nginx
kubectl logs nginx --tail=20

# Show all logs from pod nginx written in the last hour
kubectl logs nginx --since=1h

# Show logs from a kubelet with an expired serving certificate
kubectl logs nginx --insecure-skip-tls-verify-backend

# Return snapshot logs from first container of a job named hello
kubectl logs job/hello

# Return snapshot logs from container nginx-1 of a deployment named nginx
kubectl logs deployment/nginx -c nginx-1

Optional arguments 🔗

Argument

Description

--all-containers

If true, get all containers’ logs in the pod(s). Default value is false

-c

The container where the logs are displayed from

-f

Show new log entries as they are added

--insecure-skip-tls-verify-backend

Skip verifying the identity of the kubelet that logs are requested from. Use this when you want to get logs from a kubelet with an expired serving certificate

-l

A label to filter on

-p

If true, show the logs for the previous instance of the container in a pod if it exists. Default value is false

--since

Get only the latest logs within the specified time duration

--tail

Number of most recent log lines to show

restart 🔗

Description 🔗

Restart the agent on the host.

Syntax 🔗

sudo systemctl restart signalfx-agent

start 🔗

Description 🔗

Start the agent on the host.

Syntax 🔗

sudo systemctl start signalfx-agent

status 🔗

Description 🔗

Check the status of the agent on the host.

Syntax 🔗

sudo signalfx-agent status
service signalfx-agent status
systemctl signalfx-agent status

status endpoints 🔗

Description 🔗

Check the endpoints set on the agent.

Syntax 🔗

signalfx-agent status endpoints

stop 🔗

Description 🔗

Stop the agent on the host.

Syntax 🔗

sudo systemctl stop signalfx-agent

tap-dps 🔗

Description 🔗

Tail metric data points being sent to the host.

Syntax 🔗

signalfx-agent tap-dps -h
signalfx-agent tap-dps -metric 'jenkins_*'

Optional arguments 🔗

Argument

Description

-h

Get more information about the command

-metric 'jenkins_*

Description here