jookies / jasmin-monitoring

Scripts, configs and templates for monitoring RabbitMQ, Redis and Jasmin through Zabbix 2.4+.
Apache License 2.0
4 stars 12 forks source link

active check "jasmin[....]" is not supported: Unsupported item key. [SOLVED] #2

Open magojr opened 4 years ago

magojr commented 4 years ago

Hi @farirat, as we also are using Zabbix [4.0] to monitor every services we have, I've installed the jasmin monitoring module (only the jasmin one, not yet redis and rabbit). I updated parameters like server IP, usernames and password in the script and verified they are correctly working manually executing them. It seems to be all right on the zabbix server (it show a lot of items foreach customer, and upstream connection) but zabbix-agent is NOT reporting any data and ciclically log 312 lines like the one in the Subject. Every line has a different metric (Eg: "8155:20200220:105016.271 active check "jasmin[user.smppsapi.elink_count,testlink_hq]" is not supported: Unsupported item key." ) but the error is always the same: "active check jasmin[...] is not supported: Unsupported item key.".

Can you give me any idea in order to solve it? Googling I found another user with the same issue but no solution yet: https://www.zabbix.com/forum/zabbix-help/360925-unsupported-item-key Thank you!

magojr commented 4 years ago

[UPDATE] uncommenting debug lines and manually executing /etc/zabbix/script/jasmin/jasmin_get.py --host [MYHOSTNAME] I can see a huge Json (apparently correct) of data sent to the zabbix server, the repsponse is: {u'info': u'processed: 0; failed: 313; total: 313; seconds spent: 0.009224', u'response': u'success'}

On the zabbix server log i've got: cannot process item "jasmin[smppc.session,testlink_hq]" trap: item type "7" cannot be used with traps

magojr commented 4 years ago

[ SOLVED incompatibilty with zabbix 4.0 ] After a correct configuration of every py scripts and the import of the XML into the zabbix server:

After that apply the template to the host and wait some minutes to permit the discovery rule to be executed. To verify on the zabbix client side (probably the jasmin host): # /etc/zabbix/script/jasmin/jasmin_discover.py --hostname [INSERT_THE_HOSTNAME] -d smppcs should print the json list of your upstream connection # /etc/zabbix/script/jasmin/jasmin_discover.py --hostname [INSERT_THE_HOSTNAME] -d users should print the json list of your configured user in jasmin # /etc/zabbix/script/jasmin/jasmin_get.py --host [INSERT_THE_HOSTNAME] should not give you any output If you uncomment the line 144 [#print(resp)] you should see something like this: {u'info': u'processed: 313; failed: 0; total: 313; seconds spent: 0.007436', u'response': u'success'}

If failed => 0 it's working!

blueflametuna commented 4 years ago

I tried to follow your instructions, but I must have missed some steps. I'm getting errors with the discovery rules: Template App Jasmin: Jasmin users Invalid discovery rule value: cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: '<class 'lockfile.LockFailed'> Error: failed to create /tmp/irvsmpptx25089.net.mb-bdb4c740.8251'

blueflametuna commented 4 years ago

Turns out to be SELinux issue ... audit.log: type=AVC msg=audit(1594230572.380:155137): avc: denied { write } for pid=2703 comm="jasmin_discover" name="tmp" dev="dm-0" ino=67160136 scontext=system_u:system_r:zabbix_agent_t:s0 tcontext=system_u: object_r:tmp_t:s0 tclass=dir permissive=0

blueflametuna commented 4 years ago

After adding a bunch of new contexts (details if you need them)... Now I am getting: <class 'socket.error'> Error: [Errno 111] Connection refused

blueflametuna commented 4 years ago

I saw somewhere that EnableRemoteCommands=1 needs to be set, but somewhere else that there is another way to do this. I would really appreciate a reply to any of my posts. Thank you!

blueflametuna commented 4 years ago

In case anyone follows these bread crumbs, here is one more little tidbit ... The connection refused issue was solved by editing the Discovery Rules for Jasmin users & Jasmin SMPP client connectors. Changed: jasmin.discovery[{HOSTNAME},smppcs] To: jasmin.discovery[127.0.0.1,smppcs]

blueflametuna commented 4 years ago

/etc/zabbix/script/jasmin/jasmin_get.py --host [INSERT_THE_HOSTNAME] should not give you any output If you uncomment the line 144 [#print(resp)] you should see something like this: {u'info': u'processed: 313; failed: 0; total: 313; seconds spent: 0.007436', u'response': u'success'}

If failed => 0 it's working!

And if it is not 0?

blueflametuna commented 4 years ago

I cannot get jasmin[version] to work. Should this also be a zabbix trapper type? Do I need something for jasmin_get.py in the jasmin.conf file for it?