> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/ct-3000-2pb-4pb/configuracao-de-alarmes/alarme-de-intrusao.md).

# Alarme de Intrusão

### Obter Configurações de Alarme de Intrusão

Por meio da chamada abaixo é possível obter as configurações de intrusão. A intrusão de se dá pela tentativa de remoção do dispositivo de seu suporte afim de obter acesso malicioso aos cabos ou configurações.

#### Requisição - GET

`http://192.168.1.201/cgi-bin/configManager.cgi?action=getConfig&name=ChassisIntrusion`

| param                 | type   | description                   |
| --------------------- | ------ | ----------------------------- |
| `getConfig` \*        | String | Comando de Obter configuração |
| `ChassisIntrusion` \* | String | Nome da Configuração          |

#### Exemplo de Retorno - *text/plain*

```sh
table.ChassisIntrusion.Enable=true
table.ChassisIntrusion.EventHandler.AlarmOutChannels[0]=0
table.ChassisIntrusion.EventHandler.AlarmOutEnable=false
table.ChassisIntrusion.EventHandler.AlarmOutTime=60
table.ChassisIntrusion.EventHandler.BeepEnable=true
table.ChassisIntrusion.EventHandler.BeepTime=900
```

#### Exemplos

{% tabs %}
{% tab title="Python" %}

```python
import requests
 
device_ip = '192.168.1.201'
username = 'admin'
password = 'acesso1234'
 
url = "http://192.168.1.201/cgi-bin/configManager.cgi?action=getConfig&name=ChassisIntrusion".format(
                            str(device_ip),
                        )
 
digest_auth = requests.auth.HTTPDigestAuth(username, password)
rval = requests.get(url, auth=requests.auth.HTTPDigestAuth(username, password), stream=True, timeout=60, verify=False)
 
print(rval.text)
```

{% endtab %}

{% tab title="Node" %}

```javascript
const { AxiosDigestAuth } = require('@lukesthl/ts-axios-digest-auth');
 
class DeviceConfigManager {
    constructor(ip, username, password) {
        this.ip = ip;
        this.digestAuthClient = new AxiosDigestAuth({
            username: username,
            password: password,
        });
    }
 
    async setConfig(url) {
        try {
            const fullUrl = `http://${this.ip}/${url}`;
            const result = await this.digestAuthClient.get(fullUrl, {
                timeout: 2000,
            });
 
            if (result.status !== 200) {
                throw new Error();
            }
 
            return result.data;
        } catch (error) {
            throw new Error("ERROR - During Set Config");
        }
    }
}
 
// Example usage:
const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
const duressAlarmValue = true; // Replace with the actual value you want
 
const configUrl = `cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].DuressAlarmEnable=${duressAlarmValue}`;
 
deviceConfigManager.setConfig(configUrl)
    .then(response => console.log('Config set successfully:', response))
    .catch(error => console.error('Error setting config:', error));
```

{% endtab %}
{% endtabs %}

### Definir Configurações de Alarme de Intrusão

Por meio da chamada abaixo é possível definir as configurações de Alarme de Intrusão.

#### Requisição - GET

`http://192.168.1.201/cgi-bin/configManager.cgi?action=setConfig&ChassisIntrusion.Enable=true&ChassisIntrusion.EventHandler.BeepEnable=true&ChassisIntrusion.EventHandler.BeepTime=900&ChassisIntrusion.EventHandler.AlarmOutTime=60&ChassisIntrusion.EventHandler.AlarmOutEnable=false`

| param               | type    | description                                           |
| ------------------- | ------- | ----------------------------------------------------- |
| `setConfig` \*      | String  | Comando de Obter configuração                         |
| `Enable` \*         | Boolean | Habilita/Desabilita Alarme                            |
| `BeepEnable` \*     | Boolean | Habilita/Desabilita Alarme Sonoro para Antipassback   |
| `BeepTime` \*       | Boolean | Define o tempo de Alarme Sonoro                       |
| `AlarmOutEnable` \* | String  | Habilita/Desabilita saida de alarme para Antipassback |
| `AlarmOutTime` \*   | String  | Define o tempo de Saida de Alarme                     |
| `LimitedTimes` \*   | String  | Define o Limite de Tentativas                         |

#### Exemplo de Retorno - *text/plain*

```sh
OK
```

#### Exemplos

{% tabs %}
{% tab title="Python" %}

```python
import requests
 
device_ip = '192.168.1.201'
username = 'admin'
password = 'acesso1234'
 
url = "http://192.168.1.201/cgi-bin/configManager.cgi?action=setConfig&ChassisIntrusion.Enable=true&ChassisIntrusion.EventHandler.BeepEnable=true&ChassisIntrusion.EventHandler.BeepTime=900&ChassisIntrusion.EventHandler.AlarmOutTime=60&ChassisIntrusion.EventHandler.AlarmOutEnable=false".format(
                            str(device_ip),
                        )
 
digest_auth = requests.auth.HTTPDigestAuth(username, password)
rval = requests.get(url, auth=requests.auth.HTTPDigestAuth(username, password), stream=True, timeout=60, verify=False)
 
print(rval.text)
```

{% endtab %}

{% tab title="Node" %}

```javascript
const { AxiosDigestAuth } = require('@lukesthl/ts-axios-digest-auth');
 
class DeviceConfigManager {
    constructor(ip, username, password) {
        this.ip = ip;
        this.digestAuthClient = new AxiosDigestAuth({
            username: username,
            password: password,
        });
    }
 
    async setConfig(url) {
        try {
            const fullUrl = `http://${this.ip}/${url}`;
            const result = await this.digestAuthClient.get(fullUrl, {
                timeout: 2000,
            });
 
            if (result.status !== 200) {
                throw new Error();
            }
 
            return result.data;
        } catch (error) {
            throw new Error("ERROR - During Set Config");
        }
    }
}
 
// Example usage:
const deviceConfigManager = new DeviceConfigManager('192.168.1.201', 'admin', 'senha');
const configUrl = 'cgi-bin/configManager.cgi?action=setConfig&ChassisIntrusion.Enable=true&ChassisIntrusion.EventHandler.BeepEnable=true&ChassisIntrusion.EventHandler.BeepTime=900&ChassisIntrusion.EventHandler.AlarmOutTime=60&ChassisIntrusion.EventHandler.AlarmOutEnable=false';
 
deviceConfigManager.setConfig(configUrl)
    .then(response => console.log('Config set successfully:', response))
    .catch(error => console.error('Error setting config:', error));
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/ct-3000-2pb-4pb/configuracao-de-alarmes/alarme-de-intrusao.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
