Dynamic snmp

With this plugin you can perform dynamic SNMP scans.

Introduction

Ver. 15-02-2024

The purpose of this plugin is to perform dynamic SNMP scans.

Tipo: Plug-in server

Compatibility matrix

Systems where tested Rocky linux, Fedora 34
Sistemas donde funciona Cualquier sistema linux

Pre requisites

Parameters

-c
Comunity
-v
Snmp version
-h
IP to which the plugin will point
-p Port
-o base oid
-d data type
-u
Used to specify the name of the user or principal that is performing the SNMP operation
-n
Used to specify the context in which the SNMP operation will be performed
-l
This parameter specifies the security level to be applied to SNMPv3 operations. Possible values include "noAuthNoPriv" (no authentication or privacy), "authNoPriv" (authentication without privacy) and "authPriv" (authentication with privacy)
-a
This parameter is used to specify the authentication protocol to be used. It can be MD5 (Message Digest 5) or SHA (Secure Hash Algorithm).
-A
This is the authentication key used in combination with the specified authentication protocol. This key is used to verify the authenticity of SNMPv3 messages
-x
Specifies the privacy protocol to be used to encrypt the transmitted data. Possible values include DES (Data Encryption Standard) and AES (Advanced Encryption Standard).
-X
This is the privacy key used in conjunction with the privacy protocol to encrypt and decrypt the transmitted data. This key is essential to ensure the confidentiality of SNMPv3 messages.
-agent
Agent name
-names
Specific instances of an object
-branches
This option specifies the branches to be retrieved under the OIDs provided.
-t_ip
Tentacle ip
-t_port
Tentacle port
-t_opts
Tentacle opts
-t_file_path
Tentacle path
-m
Transfer mode, local o localcopy. Default: 'localcopy'
-wmin
Minimum warning threshold
-wmax
Maximum warning threshold
-cmin
Minimum critical threshold
-cmax
Maximum critical threshold
-alrt
Global alerts
-group
Group for modules
-debug
Activate debug mode

Manual execution

El formato de ejecución del plugin es el siguiente :

./dynamic_snmp.pl -agent <agent name> -h <host> -v <version> -c <comunidad> [-u username] [-a MD5] [-A auth_password] [-x DES] [-X priv_password] [-l authPriv] -o < base oid> -names <instance> -branches < branches > -nodefaults 1 [-t_ip 127.0.0.1] [-t_port 41121] [-t_opts "additional_tentacle_options"] [-t_file_path "/path/to/data_in"] [-m tentacle] [-wmin 0] [-wmax 100] [-cmin 0] [-cmax 200] [-alrt alert_name] [-group GroupName] [-debug 1]

Example:

./dynamic_snmp -agent test -h 192.168.51.1 -v 2c -c artica06  -o .1.3.6.1.2.1 -names .2.2.1.2 -branches OperStatus:.2.2.1.8,AdminStatus:.2.2.1.7 -nodefaults 1

 

Configuration in PandoraFMS

To configure the plugin in PandoraFMS, the following steps must be followed :

 

1. Upload the plugin to PandoraFMS, for example in the following path:

/usr/share/pandora_server/util/plugin

2. Go to the plugins section and create a new one:

imagen.png

    3.Name, description and timeout are added:

image.png

4. The path to the plugin is added to the command and the necessary parameters for the execution of the plugin are added. 

For each parameter a macro must be configured, the syntax of this macro being the following : _fieldx_, where x is the positional number of the parameter.

image.png

5. The previous macros are configured, adding the value of the parameter in each one:

image.png

6. Once configured, you should create a module in an agent that executes the plugin. In the modules menu of an agent we create a new plugin type module:

imagen.png

7. In the module configuration menu, we name it, select the plugin configured before and click on "create".

image.png

8. The agent will be created with the modules or the modules in the selected agent in the next execution of the plugin:

image.png

Agents and modules generated by the plugin

The plugin will create the modules in the selected agent with the -agent parameter, or otherwise it will create a new one.

image.png