You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-03-27 20:40:15

alex123765
Member
Registered: 2023-03-22
Posts: 7

Problem with SNMP on GLPI

Hi everyone

I've the problem with SNMPv2
I've a server Linux (kali) with IP 192.168.100.100 where I installed GLPI 10.0.6 and GLPI agent 14.1.
I linked the server Linux with a Cisco router (IP: 172.16.0.1 ).
I would like to add Cisco router in GLPI inventory and populate the inventory with SNMPv2. I can't install the GLPI agent in the Cisco router.

The comunication between server and Cisco router work. I ping Cisco router from server Linux and SNMP work correctly, I tested it with snmwalk.

(root㉿kali)-[~]# ping 172.16.0.1  
PING 172.16.0.1 (172.16.0.1) 56(84) bytes of data.
64 bytes from 172.16.0.1: icmp_seq=1 ttl=255 time=9.59 ms
64 bytes from 172.16.0.1: icmp_seq=2 ttl=255 time=12.5 ms
^C
--- 172.16.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 9.589/11.053/12.518/1.464 ms


(root㉿kali)-[~]# snmpwalk -v 2c -c public 172.16.0.1  
iso.3.6.1.2.1.1.1.0 = STRING: "Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 12.4(24)T5, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Fri 04-Mar-11 06:49 by prod_rel_team"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.9.1.222
iso.3.6.1.2.1.1.3.0 = Timeticks: (233637) 0:38:56.37
.....
.

I used the plugin "GLPI Inventory" for this goal and I created the two tasks, but didn't work
I tried with FusionInventory but nothig is changed.

The two tasks are:

1) Create first task for discover the network devices

In Administration -> GLPI Inventory -> IP Ranges
I created IP range with name "network" ( 172.16.0.1 - 172.16.0.255) and associated it with SNMP credentials ( v2, community: public )

In Administration -> GLPI Inventory -> Task management
I created task "Discover" and in "Job configuration" I associated Object "network" and actors GLPI agent 14.1, then I activated this task in "task managment" and I clicked on "Force start"


2) Create second task for SNMP:

In Administration -> GLPI Inventory -> Task management
I created task "SNMP" and in "Job configuration" I associated Object "network" and actors GLPI agent 14.1
I activated this task in "task managment" and I clicked on "Force start"

Finally I went to "htp://127.0.0.1:62354" and I clicked on Force Inventory

In  Administration -> GLPI Inventory -> GLPI Inventory I see only the one device, the server Linux but the Cisco router no.
I activated the agent in  Administration -> GLPI Inventory -> General setup -> Agents modules


(root㉿kali)-[~]# ls -l /var/www/html/glpi/plugins/
total 8
drwxrwxrwx 15 root root 4096 Feb 13 13:29 fusioninventory
drwxrwxr-x 15 root root 4096 Jan 24 08:04 glpiinventory

(root㉿kali)-[~]# systemctl status glpi-agent.service
● glpi-agent.service - GLPI agent
     Loaded: loaded (/lib/systemd/system/glpi-agent.service; enabled; preset: disabled)
     Active: active (running) since Mon 2023-03-27 13:01:30 EDT; 21min ago
       Docs: man:glpi-agent
   Main PID: 736 (glpi-agent: wai)
      Tasks: 1 (limit: 4552)
     Memory: 73.3M
        CPU: 806ms
     CGroup: /system.slice/glpi-agent.service
             └─736 "glpi-agent: waiting"

Mar 27 13:01:30 kali systemd[1]: Started glpi-agent.service - GLPI agent.
Mar 27 13:01:31 kali glpi-agent[736]: [info] GLPI Agent starting
Mar 27 13:01:31 kali glpi-agent[736]: [info] [http server] HTTPD service started on port 62354
Mar 27 13:01:31 kali glpi-agent[736]: [info] target server0: next run: Mon Mar 27 13:34:11 2023 - http://127.0.0.1/glpi/
(root㉿kali)-[~]# 

what is the problem?

Thanks for your support

Offline

#2 2023-03-28 09:40:41

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: Problem with SNMP on GLPI

Hi alex123765,

you may just forget to install the required tasks with the agent. What do you have as result for the following command on the console ?

glpi-agent --list-tasks

Also don't forget to check the tasks are enabled for the selected agent in GLPI.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2023-03-28 17:08:19

alex123765
Member
Registered: 2023-03-22
Posts: 7

Re: Problem with SNMP on GLPI

I'm tring with fusioninventory-agent. I see this:

(root㉿kali)-[~]# fusioninventory-agent --list-task                                
Available tasks : 
WMI (v0.3)
Collect (v2.6)
NetInventory (v4.2)
Inventory (v1.10)
WakeOnLan (v2.2)
Maintenance (v1.1)
NetDiscovery (v4.2)

server target: http://192.168.100.100/glpi/plugins/fusioninventory/
Planned tasks:
 - WMI (v0.3)
 - NetInventory (v4.2)
 - Collect (v2.6)
 - Inventory (v1.10)
 - NetDiscovery (v4.2)
 - WakeOnLan (v2.2)

scheduler target: scheduler0
Planned tasks:
 - Maintenance (v1.1)

I sended this command for discover my router (172.16.0.1).

 (root㉿kali)-[~]# fusioninventory-netdiscovery --first 172.16.0.1 --last 172.16.0.2 -s  /var/www/html/glpi/plugins/fusioninventory/
[info] [thread 1] #1, Saving 172.16.0.1 discovery infos as XML...
(root㉿kali)-[~]#  

and then I tried to import it in GLPI with this command:

 (root㉿kali)-[/var/…/glpi/plugins/fusioninventory/netdiscovery]# fusioninventory-agent --additional-content 172.16.0.1.xml 
[info] target server0: server http://192.168.100.100/glpi/plugins/fusioninventory/
[info] sending prolog request to server0
[info] running task Collect
[info] No Collect job enabled or Collect support disabled server side.
[info] running task Inventory
[info] New inventory from kali-2023-03-27-18-26-09 for server0
[error] unknown section PROCESSNUMBER at /usr/share/fusioninventory/lib/FusionInventory/Agent/Inventory.pm line 272.

I don't know that this is correct...Can you help me?

Thanks

Last edited by alex123765 (2023-03-28 17:17:43)

Offline

#4 2023-03-28 18:01:22

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: Problem with SNMP on GLPI

Why switching to fusioninventory-agent which is older than glpi-agent and no more supported by the current fusioninventory project maintainer ?


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#5 2023-03-30 21:14:16

KernelGad
Member
Registered: 2023-03-23
Posts: 5

Re: Problem with SNMP on GLPI

Kali Linux is for penetration testing and I would suggest not using it for GLPI installations or any other server at all other than its intended use. Are you able to replicate the problem on a different Linux ditro and verify if the same problem exists thereafter?

Offline

#6 2023-04-02 19:01:16

alex123765
Member
Registered: 2023-03-22
Posts: 7

Re: Problem with SNMP on GLPI

I resolved it.

I've another question.
When I tried to create an inventory with glpi-netinventory it worked but, I have two different behaviors.

ROUTER: 172.16.0.1 ( this is the IP of the LAN MGT, I several networks)
SWITCH: 172.16.0.100 ( this is the IP of the LAN MGT, in the switch I have only VLAN layer 3 and others vlans are layer2 )
LAN MGT: VLAN 2 -> 172.16.0.0/24



If I debug the request I see this:

SWITCH DEBUG

 
(root㉿kali)-[~]# glpi-netinventory --host 172.16.0.100  --debug
[debug] Logger backend Stderr initialized
[debug] GLPI Agent (1.4-1)
[debug] Current run expiration timeout: 1.0 hour
[debug] creating 1 worker threads
[debug] [thread 1] creation
[debug] [thread 1] #1, scanning 0: 172.16.0.100
[debug] [thread 1] #1, full match for sysobjectID .1.3.6.1.4.1.9.1.185 in database
[debug] [thread 1] #1, switching SNMP context to vlan 10
[debug] [thread 1] #1, switching SNMP context to vlan 22                          >>> ALL THESE NETWORK ARE LAYER 2 ON THE SWITH, THE VLAN 2 IS THE ONLY LAN LAYER 3. 
[debug] [thread 1] #1, switching SNMP context to vlan 20
<?xml version="1.0" encoding="UTF-8" ?>
.......

ROUTER DEBUG

 
(root㉿kali)-[~]# glpi-netinventory --host 172.16.0.1 --timeout 1 --threads 1 --debug 
[debug] Logger backend Stderr initialized
[debug] GLPI Agent (1.4-1)
[debug] Current run expiration timeout: 1.0 hour
[debug] creating 1 worker threads
[debug] [thread 1] creation
[debug] [thread 1] #1, scanning 0: 172.16.0.1
[debug] [thread 1] #1, full match for sysobjectID .1.3.6.1.4.1.9.1.222 in database
<?xml version="1.0" encoding="UTF-8" ?>
......

The question is.
Why in the switch the glpi-netinventory try all networks and only at the end it  try the correct network?
This behavior does not appear on the router.

For me fix it is important because decreases the time to scan the network.

Thanks for your support

Last edited by alex123765 (2023-04-02 19:05:01)

Offline

#7 2023-04-03 09:54:57

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: Problem with SNMP on GLPI

The "switching SNMP context to vlan XX" messages are related to a mechanism which tries to find all connected devices and, specifically, this will only add detected mac addresses to connections.
I see nothing to fix there.
Also you're wanting to decrease the time to scan but said nothing about how the timing of your scans. The best way to reduce scan timing is to use threads.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

Board footer

Powered by FluxBB