Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
magojr opened this issue Feb 20, 2020 · 9 comments

Comments

@magojr
Copy link

magojr commented Feb 20, 2020

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
Copy link
Author

magojr commented Feb 20, 2020

[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 magojr changed the title active check "jasmin[....]" is not supported: Unsupported item key. active check "jasmin[....]" is not supported: Unsupported item key. [SOLVED] Feb 21, 2020
@magojr
Copy link
Author

magojr commented Feb 21, 2020

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

  • On the zabbix server web interface: go to configuration -> templates -> Template App Jasmin
  • For each item (25), change the type from "Zabbix agent (active)" to "Zabbix trapper"
  • In the same "Template" section select the tab "Discovery rules"
  • For both the lines ("Jasmin SMPP client connectors" and "Jasmin users") go into "Item prototypes" and do the same action (change the type from "Zabbix agent (active)" to "Zabbix trapper")

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

blueflametuna commented Jul 24, 2020

/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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants