# SmartSense Agent

## Introduction

This manual describes the installation procedure for the **SmartSense Agent**.

## Installation Preparation

This section covers the essential steps required for installation.

{% hint style="warning" %}
All steps must be performed with root privileges on all nodes, unless otherwise indicated.
{% endhint %}

To install SmartSense, you will need:

* Root access on the server
* File *.rpm* of the SmartSense Agent

{% hint style="info" %}
If you do not have the file, contact the Griaule support team.
{% endhint %}

{% hint style="warning" %}
Make sure that the version of the SmartSense Agent being installed is compatible with the installed GBDS version.
{% endhint %}

Then, follow the steps below.

1. Log in to the server as root.
2. [Install the SmartSense Agent](#instalando-o-smartsense-agent).

## Installing the SmartSense Agent

Transfer or download the file `.rpm` on the server.

Go to the directory where the file `.rpm` is located and run the command:

{% hint style="info" %}
Make sure to replace `<version>` with the version of the SmartSense Agent being installed.
{% endhint %}

```bash
rpm -ivh gbs-smartsense-agent-<version>.rpm
                              ^^^^^^^^
```

Then, edit the SmartSense Agent configuration file:

```bash
vim /etc/griaule/conf/gbs-smartsense-agent/application.properties
```

Pay special attention to the following properties, making sure to correctly set the hostname, username, and database password where indicated:

```properties
gbds.rdb.url=jdbc:mysql://<HOSTNAME>:3306/gbds?useSSL=false
                          ^^^^^^^^^^

gbds.rdb.username=<DB-Username>
                  ^^^^^^^^^^^^^

gbds.rdb.password=<DB-Password>
                  ^^^^^^^^^^^^^
```

Finally, start the SmartSense Agent:

```bash
/var/lib/griaule/gbs-smartsense-agent/scripts/start-smartsense.sh
```

And monitor the startup log:

```bash
/var/lib/griaule/gbs-smartsense-agent/scripts/tail-smartsense.sh
```

### Aliases

Aliases are short, user-defined commands that serve as substitutes for longer or more complex commands. They are created to make frequently used commands more convenient to run. When an alias is invoked, it is replaced by the full command it represents before being executed.

To add the SmartSense Agent aliases, edit the file `.bashrc` root:

```sh
vim /root/.bashrc
```

And add the following aliases:

```bash
alias agentstart='/var/lib/griaule/gbs-smartsense-agent/scripts/start-smartsense.sh'
alias agentstop='/var/lib/griaule/gbs-smartsense-agent/scripts/stop-smartsense.sh'
alias agentstatus='/var/lib/griaule/gbs-smartsense-agent/scripts/smartsense-status.sh'
alias agenthome='cd /var/lib/griaule/gbs-smartsense-agent/'
alias agentlogt='/var/lib/griaule/gbs-smartsense-agent/scripts/tail-smartsense.sh'
alias agentconf='vim /etc/griaule/conf/gbs-smartsense-agent/application.properties'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.griaule.com/gbs/en/gbds-installation/smartsenseagent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
