Skip to main content

Could you please add option to filter out memory pools when using D-Link devices.
Currently there only seems to be option to change warning and critical thresholds:
--warning-* --critical-*
Thresholds. Can be: 'usage' (B), 'usage-free' (B), 'usage-prct'
(%).

/usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.3.4' --snmp-community='public' --snmp-version='2c' --warning-usage-prct='85' --critical-usage-prct='90'
CRITICAL: Memory 'unit1flash' total: 29.24 MB used: 27.60 MB (94.41%) free: 1.63 MB (5.59%) | 'unit1dram#memory.usage.bytes'=76844032B;;;0;268435456 'unit1dram#memory.free.bytes'=191590400B;;;0;268435456 'unit1dram#memory.usage.percentage'=28.63%;0:85;0:90;0;100 'unit1flash#memory.usage.bytes'=28943360B;;;0;30655488 'unit1flash#memory.free.bytes'=1712128B;;;0;30655488 'unit1flash#memory.usage.percentage'=94.41%;0:85;0:90;0;100
Memory 'unit1dram' total: 256.00 MB used: 73.28 MB (28.63%) free: 182.71 MB (71.37%)
Memory 'unit1~flash' total: 29.24 MB used: 27.60 MB (94.41%) free: 1.63 MB (5.59%)

Thanks in advance!

NewDiscussion ongoing

@katska please detail your idea. It is unclear what you want to achieve. seems like you do not want thresholds on memory? But these do not show in the command you included?


No, I just want to exclude memory pool 'unit1flash' from being checked. 


Hi, you can use the --filter-perfdata option to keep only what interests you.

To exclude a pattern, you may use regular expressions in negative lookahead way. I can’t test it right now, but something like this may work: --filter-perfdata='^(?!(unit1flash))'

 


bash-5.1$ /usr/lib/centreon/plugins//centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.2.8' --snmp-community='ggg' --snmp-version='2c'  --warning-usage='' --critical-usage='' --warning-usage-free='' --critical-usage-free='' --warning-usage-prct='85' --critical-usage-prct='90' --verbose --filter-perfdata='^(?!(unit1~flash))'

CRITICAL: Memory 'unit1~flash' total: 29.24 MB used: 27.60 MB (94.41%) free: 1.63 MB (5.59%) | 'unit1~dram#memory.usage.bytes'=76828672B;;;0;268435456 'unit1~dram#memory.free.bytes'=191605760B;;;0;268435456 'unit1~dram#memory.usage.percentage'=28.62%;0:85;0:90;0;100

Memory 'unit1~dram' total: 256.00 MB used: 73.27 MB (28.62%) free: 182.73 MB (71.38%)

Memory 'unit1~flash' total: 29.24 MB used: 27.60 MB (94.41%) free: 1.63 MB (5.59%)


@katska is your problem solved with the filter?


Hi, no, the issue is still there.

I still checks the Memory 'unit1~flash’ and gives me error. The --filter-perfdata='^(?!(unit1~flash))' removed the memory pool from graphs only. I need to filter the pool out so it is not checked and it does not give me error all the time.


Hi @katska,

After looking at the plugin’s code, you won’t get what you expect in it’s current state, it needs a small evolution.

Can you run this command and send the output here?

/usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.3.4' --snmp-community='public' --snmp-version='2c' --warning-usage-prct='85' --critical-usage-prct='90' --debug

It will allow us to simulate your device and test our developments.


Discussion ongoingNeeds Votes

bash-5.1$ /usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.3.8' --snmp-community='public' --snmp-version='2c' --warning-usage-prct='85' --critical-usage-prct='90' --debug

CRITICAL: Memory 'unit1~flash' total: 29.24 MB used: 27.57 MB (94.30%) free: 1.67 MB (5.70%) | 'unit1~dram#memory.usage.bytes'=76857344B;;;0;268435456 'unit1~dram#memory.free.bytes'=191578112B;;;0;268435456 'unit1~dram#memory.usage.percentage'=28.63%;0:85;0:90;0;100 'unit1~flash#memory.usage.bytes'=28908544B;;;0;30655488 'unit1~flash#memory.free.bytes'=1746944B;;;0;30655488 'unit1~flash#memory.usage.percentage'=94.30%;0:85;0:90;0;100

.1.3.6.1.4.1.171.14.5.1.4.1.3.1.1 = 262144

.1.3.6.1.4.1.171.14.5.1.4.1.3.1.2 = 29937

.1.3.6.1.4.1.171.14.5.1.4.1.4.1.1 = 75056

.1.3.6.1.4.1.171.14.5.1.4.1.4.1.2 = 28231

.1.3.6.1.4.1.171.14.5.1.4.1.5.1.1 = 187088

.1.3.6.1.4.1.171.14.5.1.4.1.5.1.2 = 1706

Memory 'unit1~dram' total: 256.00 MB used: 73.30 MB (28.63%) free: 182.70 MB (71.37%)

Memory 'unit1~flash' total: 29.24 MB used: 27.57 MB (94.30%) free: 1.67 MB (5.70%)


Hi @katska,

There is something missing in the OIDs displayed. I suppose they’re stored in cache files

can you run this command to make the plugin query all the needed OIDs?

/usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.3.8' --snmp-community='public' --snmp-version='2c' --warning-usage-prct='85' --critical-usage-prct='90' --debug --statefile-dir=/tmp

 


/usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl --plugin=network::dlink::standard::snmp::plugin --mode=memory --hostname='1.2.3.8' --snmp-community='public' --snmp-version='2c' --warning-usage-prct='85' --critical-usage-prct='90' --debug --statefile-dir=/tmp

Unknown option: statefile-dir at /usr/lib/centreon/plugins/centreon_dlink_standard_snmp.pl line 155.


My bad! the names (unit1, ...) don’t come from the device itself but are built by the plugin.

It would be a rather simple enhancement to filter that 👍🏻


Hello.
 

From my experience of working with monitoring different models of D-Link switches, I can say that this is the stupidest vendor. They produce different MIBs for each model and having universal plugins, such as for Cisco, is an almost impossible task.
 

The simplest solution is to use the powerful universal plugin "apps::protocols::snmp::plugin". All you need is to know those unique OIDs that relate to a particular model and that will give you the information you need.

Here is an example in which I use memory monitoring for a separate switch model D-Link DGS-1210-52MP with its own specific OIDs;
 

./centreon_plugins.pl' '--plugin=apps::protocols::snmp::plugin' '--mode=numeric-value' 
'--config-json' '' { "oid": ".1.3.6.1.4.1.171.11.153.1000.1.47.1.0", "perfdata_name": "memory.utilization.5s.percentage", "perfdata_max": "100", "format": "Memory 5 sec. average usage is %s%%" }, { "oid": ".1.3.6.1.4.1.171.11.153.1000.1.47.2.0", "perfdata_name": "memory.utilization.1m.percentage", "format": "Memory 1 min. average usage is %s%%", "perfdata_max": "100" , "warning": "0:90", "critical": "0:98" }, { "oid": ".1.3.6.1.4.1.171.11.153.1000.1.47.3.0", "perfdata_name": "memory.utilization.5m.percentage", "perfdata_max": "100" , "format": "Memory 5 min. average usage is %s%%", "warning": "0:90", "critical": "0:98" } ]'
'--hostname' 'dlinkswitch' '--snmp-community' 'ohmy' '--snmp-version' '2c'

OK: Memory 5 sec. average usage is 35% - Memory 1 min. average usage is 35% - Memory 5 min. average usage is 35% |

memory.utilization.5s.percentage=35;;;;100
memory.utilization.1m.percentage=35;0:90;0:98;;100
memory.utilization.5m.percentage=35;0:90;0:98;;100

 


Hello :)

We gave your idea a chance to be voted on by the community. However, some time has gone by since this idea was put to the vote without it garnering many votes. We're convinced that your need is legitimate and well thought-out, but unfortunately we receive a huge number of idea proposals and we have to sort and prioritise those that best reflect the needs indicated by the community (via the votes). That's why we need to decline this idea as a community idea for better visibility. This doesn't mean that your need can't be solved, you can try to make do with the collections (see the dedicated tutorials) or request a quote from Centreon support if you want to have this development carried out.

Kind regards.


Needs VotesDeclined