Do you have more devices added than what is returned by that? If it’s the same amount then run (this will take a long time if you have a lot of devices):
./discovery.php -h all -v > /tmp/disco.txt &
If it’s less then run:
./discovery.php -h HOSTNAME -v > /tmp/disco.txt
Replace HOSTNAME with one from the output of the query.
Post the output of tail -10 /tmp/disco.txt from either when done.
I have 119 devices on the All Devices web page and the query returns 116 records.
(I had to remove the ignore = 0 from the sql query as it would not run with it included, however I know that there is only 1 device that is ignored)
It could be that one device is causing discovery.php to crash so I’d be inclined to run the full -h all as mentioned above - redirected to a file so we can see what’s gone on. Maybe run it in screen if you can’t stay connected to the shell until it’s finished.
Ok, so it seems that the script has not completed, the terminal I ran it from is stuck. The last output in that window is: ifStackStatus: Unknown Object Identifier (Sub-id not found: (top) -> ifStackStatus)
From another terminal I ran the tail command and got this:
librenms@librenms:~$ tail -10 /tmp/disco.txt
Modules status: Global- OS Device Module [ mef ] disabled globally.
SQL[SELECT attrib_value FROM devices_attribs WHERE `device_id` = '1' AND `attrib_type` = 'poll_mib' ]
SQL[UPDATE `devices` set `last_discovered` =NOW(),`last_discovered_timetaken` ='1.801' WHERE `device_id` = '1']
Discovered in 1.801 seconds
SQL[INSERT INTO `perf_times` (`type`,`doing`,`start`,`duration`,`devices`,`poller`) VALUES ('discover','all','1493106236.4222','1239.','116','librenms\n')]
./discovery.php all 2017-04-25 09:04:36 - 116 devices discovered in 1239. secs
SNMP: Get[1835/101.72s] Walk [4089/1022.22s]
MySQL: Cell[5686/2.68s] Row[2048/0.97s] Rows[4152/2.51s] Column[116/0.08s] Update[3079/1.69s] Insert[394/0.31s] Delete[254/0.12s]
Well, that’s the thing. When I ran it this morning it wasn’t 24 hours since I manually ran discovery.
In fact, I just ran it again and then validated immediately after and got the same warning.
Both of those commands return the correct info, system time zone is BST and the time is correct.
I had a look at the query that validate is running and ran it manually, I got 2 devices that have not completed discovery recently, one for just over a day and one not for a few weeks.
I manually ran discovery against both and now the error is gone.
Odd though, they are not ignored or disabled and one is our domain server, so I know it hasn’t been down.