Memcached treasure or MKP don't work with version 1.5.x of memcached

Hi all !

I have migrated my centos memcached server from centos7 to ubuntu. And from version 1.4.15 to 1.5.22.
Using Check_mk 2.0.0p4 and the mkp of memcached5.3 OR from the treasure directly. Memcached monitoring don’t seem to work with memcached version 1.5.22.

I am not sure I am in the correct place to let people know. But here I am.

I am willing to do test if needed. I was able to do a few client modification so that running the agent return the memcached section correctly. But on the server side it’s as if it’s unable to parse through the info.

To test I have installed memcached:

# dpkg -l memcached
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version           Architecture Description
+++-==============-=================-============-================================================
ii  memcached      1.5.22-2ubuntu0.2 amd64        High-performance in-memory object caching system

The agent plugin happily connects to memcached and outputs its section:

# ./mk_memcached 
<<<memcached>>>
[127.0.0.1:11211]
pid 2241449
uptime 179
time 1630398024
version 1.5.22
libevent 2.1.11-stable
pointer_size 64
rusage_user 0.033957
rusage_system 0.029106
max_connections 1024
curr_connections 1
total_connections 3
rejected_connections 2
connection_structures 2
reserved_fds 20
cmd_get 0
cmd_set 0
cmd_flush 0
cmd_touch 0
cmd_meta 0
get_hits 0
get_misses 0
get_expired 0
get_flushed 0
delete_misses 0
delete_hits 0
incr_misses 0
incr_hits 0
decr_misses 0
decr_hits 0
cas_misses 0
cas_hits 0
cas_badval 0
touch_hits 0
touch_misses 0
auth_cmds 0
auth_errors 0
bytes_read 14
bytes_written 1902
limit_maxbytes 67108864
accepting_conns 1
listen_disabled_num 0
time_in_listen_disabled_us 0
threads 4
conn_yields 0
hash_power_level 16
hash_bytes 524288
hash_is_expanding 0
slab_reassign_rescues 0
slab_reassign_chunk_rescues 0
slab_reassign_evictions_nomem 0
slab_reassign_inline_reclaim 0
slab_reassign_busy_items 0
slab_reassign_busy_deletes 0
slab_reassign_running 0
slabs_moved 0
lru_crawler_running 0
lru_crawler_starts 510
lru_maintainer_juggles 228
malloc_fails 0
log_worker_dropped 0
log_worker_written 0
log_watcher_skipped 0
log_watcher_sent 0
bytes 0
curr_items 0
total_items 0
slab_global_page_pool 0
expired_unfetched 0
evicted_unfetched 0
evicted_active 0
evictions 0
reclaimed 0
crawler_reclaimed 0
crawler_items_checked 0
lrutail_reflocked 0
moves_to_cold 0
moves_to_warm 0
moves_within_lru 0
direct_reclaims 0
lru_bumps_dropped 0

What is your exact issue?

Hello,

It is a fresh install of ubuntu20.04.

# dpkg -l |grep memcached
ii  libmemcached-tools                   1.0.18-4.2ubuntu2                     amd64        Commandline tools for talking to memcached via libmemcached
ii  libmemcached11:amd64                 1.0.18-4.2ubuntu2                     amd64        C and C++ client library to the memcached server
ii  libmemcachedutil2:amd64              1.0.18-4.2ubuntu2                     amd64        library implementing connection pooling for libmemcached
ii  memcached                            1.5.22-2ubuntu0.1                     amd64        High-performance in-memory object caching system

I took the mk_memcached from : /opt/omd/versions/2.0.0p4.cre/share/doc/check_mk/treasures/memcached/agents/plugins/mk_memcached

On the ubuntu server :

# ps axf|grep memcache
/usr/bin/memcached -m 4096 -p 11211 -u memcache -l 0.0.0.0 -c 4096 -P /var/run/memcached/memcached.pid

I ran

#/usr/lib/check_mk_agent/plugins/mk_memcached

which returns nothing

So I created a /etc/check_mk/memcached.cfg with

instances = [
 ("localhost", 11211),
]

Then I ran

# /usr/lib/check_mk_agent/plugins/mk_memcached
<<<memcached>>>
[localhost:11211]

it stays stuck there.

Did you install the extension from Checkmk Exchange?

It contains a modified agent plugin mk_memcached that includes auto-detection. You’ll find it in $OMD_ROOT/local/share/check_mk/agents/plugins.

Hello again.
Thanks for your time!

I tried both the one in the treasure folder ( which is what I did in my previous post)

I also tried the one from the memcached5.3 mkp.

If I use under my memcached server the file from
$OMD_ROOT/local/share/check_mk/agents/plugins/mk_memcached

I get the following

# ./mk_memcached 
/usr/bin/env: ‘python’: No such file or directory

Since I only have python3 on that machine I went and changed the first line

from
#!/usr/bin/env python
to
#!/usr/bin/env python3

This gives me

# ./mk_memcached 
  File "./mk_memcached", line 117
    print '<<<memcached>>>'
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('<<<memcached>>>')?

And then it goes down into quite a few modification along those line.

You do not have Python 2 installed any more. Luckily the 2.0 agent copes with that. Unfortunately the agent plugin has to be migrated.

You can find the plugin for Python 3 in the memcached 5.4 extension package: memcached-5.4.mkp (8.4 KB)

For python2 I think it’s just not installed by default under ubuntu20.04 where they favor python3.

I updated to 5.4 and used the included “new” plugin working with python3 named memcached.py
I put it in place on the memcached server. The plugin works. And after a few minute it shows as a new service under WATO.

I added that and now the service is associated to my server. But it’s been over 15 minutes and nothing seems to be received to show for. No data no graph.

When I do a test connection of the host. I see the data being sent by the client. But it’s as if it’s not read correctly by cmk and so does not show or graph under the host.

Well it took 2 hours. But it seems to have decided to move along. And now everything is fine.
So I guess it was all about the memcached5.4 with added support for python3.

Thanks a lot for your time!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.