View Full Version : zabbix_sender - fustrated newbie
Hi,
Originally posted this in the suggestions and feedback section by mistake.
I am trying to use zabbix_sender on our zabbix server. The syntax I've tried using are:
(where m-prodmon-001 is the name of the zabbix server, rob.test is the key)
zabbix_sender -z serveripadddress -p 10051 -s m-prodmon-001 -k rob.test -o 1
zabbix_sender -z m-prodmon-001 -p 10051 -s m-prodmon-001 -k rob.test -o 1
zabbix_sender -z localhost -p 10051 -s m-prodmon-001 -k rob.test -o 1
zabbix_sender -z localhost -p 10051 -s localhost -k rob.test -o 1
all return the same terse error message:
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000944"
sent: 1; skipped: 0; total: 1
I've spent hours trying to get this to work. Any help or suggestions offered would be greatly appreciated.
Thanks
Hi,
Did you create the item in ZABBIX interface acording with your 'keys' ? You need create a item (trapper) to receive this data.
And in your zabbix_server.log ? Have some information about errors ?
[]s,
Luciano
thanks for the reply.
Just to clarify; I've created an item of type 'trapper' with a unique key 'rob.test'. I've also created a trigger for the item. The command line call I'm using is run on the zabbix server itself, the command being: zabbix_sender -z <ZabbixServerIPAddress> -p 10051 -s m-prodmon-001 -k rob.test -o 1.
m-prodmon-001 is the name of the zabbix server.
I tail -f the zabbix_server log when I run the command but can see no errors being reported.
Any other ideas or suggestions would be greatly appreciated. BTW, the reason I want to use zabbix_sender is for 'once a day' checks. I know I could kind of do this using the date function on the trigger, however, the item definition would still execute the check during the day; it's just that the trigger wouldn't 'fire' until a specified time. I don't want to do this as I don't want to send traffic across the network - we have quite a few 'once a day checks' for files, website, and sql databases.
Ok, couple things we should look at.
1. Is the server also defined as a client in zabbix? If not I don't believe this will work.
2. The item rob.test, what is the type of the item? i.e. Numeric integer, float, text.
tighep,
thanks for the reply.
The server is also set up as a client. Also the item rob.test is defined as numeric integer and the trigger is set to fire when 1 is returned.
However, as stated before, when I run the zabbix_sender command from the command line of the zabbix_server, I get the very terse error at the command line with nothing being reported in the logfile.
Any further ideas or suggestions?
Thanks
The Trapper item in the zabbix server also has a allowed_hosts list.
Did you enter servers in there or is it still empty. If you added server names there, remove all of them.
An empty list means *any* server may send values for this host/item.
Also the item rob.test is defined as numeric integer ...
Zabbix Traps use 'Character' for Type of Information. Yes I know, '1' looks like a number but in a trap it's really a string. ;)
MrKen
Hi,
Thanks for the help so far, but we're still pulling our hair out.
Here's some extra information, in case anyone can spot the issue. I'm sure that it's something minor that's being missed. (We did try switching to a character type from Int64, but there was no change in the error.)
In Zabbix, added to the zabbix server host is a data type with a key of sender.test (click link below to view...).
Data Item Screenshot (http://img125.imageshack.us/my.php?image=zabbixdataitempx8.png) (Imageshack.us)
From the command line, we run...
zabbix_sender -v -z 172.16.10.21 -s "ZABBIX SERVER" -k sender.test -o b
The output that's returned says that it failed...
Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.001101"
sent: 1; skipped: 0; total: 1
In the server log file, running in debug, we see..
16328:20090202:162042 Trapper got [{
"request":"sender data",
"data":[
{
"host":"ZABBIX SERVER",
"key":"sender.test",
"value":"b"}]}] len 110
16328:20090202:162042 In process_new_values()
16328:20090202:162042 In process_mass_data()
16328:20090202:162042 In DCinit_nextchecks()
16328:20090202:162042 Query [select i.itemid,i.key_,h.host,h.port,i.delay,i.descriptio n,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h .useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.ho stid,h.status,i.value_type,h.errors_from,i.snmp_po rt,i.delta,i.prevorgvalue,i.lastclock,i.units,i.mu ltiplier,i.snmpv3_securityname,i.snmpv3_securityle vel,i.snmpv3_authpassphrase,i.snmpv3_privpassphras e,i.formula,h.available,i.status,i.trapper_hosts,i .logtimefmt,i.valuemapid,i.delay_flex,h.dns,i.para ms,i.trends,h.useipmi,h.ipmi_port,h.ipmi_authtype, h.ipmi_privilege,h.ipmi_username,h.ipmi_password,i .ipmi_sensor from hosts h, items i where h.hostid=i.hostid and h.proxy_hostid=0 and h.status=0 and i.status in (0,3) and i.type in (2,7) and ((h.host='ZABBIX SERVER' and i.key_='sender.test')) and h.hostid between 000000000000000 and 099999999999999]
16328:20090202:162042 In DCflush_nextchecks()
It's as if the query is run, and then the process quits. That process (16328) doesn't show up in the log file again.
The actual query does return a row too...
*************************** 1. row ***************************
itemid: 23950
key_: sender.test
host: ZABBIX Server
port: 10050
delay: 30
description: Sender Test
nextcheck: 0
type: 2
snmp_community: public
snmp_oid: interfaces.ifTable.ifEntry.ifInOctets.1
useip: 1
ip: 127.0.0.1
history: 90
lastvalue: NULL
prevvalue: NULL
hostid: 10017
status: 0
value_type: 1
errors_from: 0
snmp_port: 161
delta: 0
prevorgvalue: NULL
lastclock: NULL
units:
multiplier: 0
snmpv3_securityname:
snmpv3_securitylevel: 0
snmpv3_authpassphrase:
snmpv3_privpassphrase:
formula: 1
available: 1
status: 0
trapper_hosts:
logtimefmt:
valuemapid: 0
delay_flex:
dns:
params: DSN=<database source name>\nuser=<user name>\npassword=<password>\nsql=<query>
trends: 365
useipmi: 0
ipmi_port: 623
ipmi_authtype: 0
ipmi_privilege: 2
ipmi_username:
ipmi_password:
ipmi_sensor:
1 row in set (0.00 sec)
There has to be something that we're missing, anyone have any further clues?
Cheers.
From the command line, we run...
zabbix_sender -v -z 172.16.10.21 -s "ZABBIX SERVER" -k sender.test -o b
Just guessing, but:
1. Your image has the server name as ZABBIX Server, but in the above you have ZABBIX SERVER. [Also, maybe, you could try changing the host name so that there is no space, perhaps an underscore - ZABBIX_Server. I recall having a problem with spaces in host names for something once before.]
2. Above example has no -p 10051
Hope this helps!
MrKen
Yeah Duh... It was of course the case sensitivity of the host name.
Just to clarify for other people who might read this later... We discovered that the port is optional and only needed if it's not using the default port and each data item can support integer, character etc, not just the character type.
Furthermore, if a host is behind a proxy, then you can't use the zabbix_sender to push data for that host, direct to the Zabbix server. (Because the query's looking for entries where there's no proxy involved.) We haven't tested it yet, but we presume that you can instead send to the proxy host, for that host, which will then forward on the data correctly.
Thanks for the input guys.