Problems with applications module and squid

Hello,

I’m trying to monitor a couple of squid servers, I configured everything as per the guide and I get the snmp info from the system correctly (cpu, RAM, disk, network, etc.), but I can’t get SNMP data from squid application.
The proxy is correctly set up and snmpget and snmpwalk launched from the librenms servers are fine with squid OIDs.

The problem, seen launching the discovery manually with -vvv, seems to be that snmpget has a “-Cc” switch which isn’t a valid option for this command (while it’s valid for snmpwalk), and therefore the command fails and results are not read.

  • The output of ./validate.php
===========================================
Component | Version
--------- | -------
LibreNMS  | 25.3.0-91-g266c806a1 (2025-04-03T23:56:41+02:00)
DB Schema | 2025_03_19_205700_fix_ospfv3_ports_table (331)
PHP       | 8.3.19
Python    | 3.10.12
Database  | MariaDB 10.6.21-MariaDB-0ubuntu0.22.04.2
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================

[OK]    Composer Version: 2.8.6
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is unavailable
[OK]    rrdtool version ok
[OK]    Connected to rrdcached

./discovery.php -h HOSTNAME -d | ./pbin.sh

[https://p.libren.ms/view/cd9f6b72]

./poller.php -h HOSTNAME -r -f -d | ./pbin.sh

[https://p.libren.ms/view/a8176480]

Thanks in advance!
Francesco

Well that’s neat. That’s what I get for trusting an old bug report.

in fact, -Cc should never be added to any snmpget command. It makes only sense in walks. I don’t think there is an easy way to prevent -Cc to be added to snmpget commands. The allowUnordered call has no way to know if we are in a get or in a walk.

Hello,

yes, I agree… -Cc is only for snmpwalk, and should be added when allowUnordered is matched and not inserted otherwise.

I’m not a developer, so I’m not very helpful.

Let me know if there is a way to fix this issue.

Thanks, best regards,

Francesco

Hi @fpasqua75
When checking your discovery logs, I don’t see any error in the application discovery part, mostly because nothing is discovered at all. Did you enable the squid application ?
You can run the discovery with -m applications to only rediscover the application part.

Hi,

yes, squid application is enabled.
Now the logs seem different from last week, maybe there was a code change during the weekend?

Now this is the error I get when issuing this command:

lnms device:poll proxyweb2.leodom.it -vvv
Error polling applications module for proxyweb2.leodom.it. Error: Cannot use object of type LibreNMS\Data\Source\SnmpResponse as array in /opt/librenms/includes/polling/applications/squid.inc.php:49
Stack trace:
#0 /opt/librenms/includes/polling/applications.inc.php(11): include()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(240): LibreNMS\Modules\LegacyModule->{closure}()
#2 /opt/librenms/includes/polling/applications.inc.php(6): Illuminate\Support\Collection->each()
#3 /opt/librenms/LibreNMS/Modules/LegacyModule.php(113): include('...')
#4 /opt/librenms/app/Jobs/PollDevice.php(140): LibreNMS\Modules\LegacyModule->poll()
#5 /opt/librenms/app/Jobs/PollDevice.php(64): App\Jobs\PollDevice->pollModules()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\PollDevice->handle()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\Bus\Dispatcher->dispatchNow()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\Pipeline\Pipeline->then()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\Queue\CallQueuedHandler->call()
#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(43): Illuminate\Queue\Jobs\Job->fire()
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(254): Illuminate\Queue\SyncQueue->push()
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(230): Illuminate\Bus\Dispatcher->pushCommandToQueue()
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(95): Illuminate\Bus\Dispatcher->dispatchToQueue()
#25 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(76): Illuminate\Bus\Dispatcher->dispatchSync()
#26 /opt/librenms/app/Console/Commands/DevicePoll.php(79): App\Jobs\PollDevice::dispatchSync()
#27 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()
#28 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#29 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#31 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#32 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#33 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#34 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#35 /opt/librenms/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()
#36 /opt/librenms/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#37 /opt/librenms/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#38 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#39 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()
#40 /opt/librenms/lnms(38): App\Console\Kernel->handle()
#41 {main}

Hi,

I think I found a solution.

In “/opt/librenms/includes/polling/applications/squid.inc.php” line 47, I added the bold part:

$returnedoids = SnmpQuery::numeric()->get($oids)->values();

Now it seems that everything works, and Squid data are fetched correctly.

I’m not a programmer, so I don’t know how to contribute to the code or share the edit, if someone can give me some advice or do it…

Thanks a lot!

Francesco

This worked for me also my squid graphs are back !!! thank you !

1 Like

@fpasqua75 thanks for the fix. I added it to LibreNMS for you. Next time submit the change for everyone. On github, you can browse to the file, click edit and then make the change, afterwards, you can create a pull request of the change to request it be added to LibreNMS :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.