ZABBIX Forums  
  #1  
Old 18-09-2012, 20:44
Synthead Synthead is offline
Junior Member
 
Join Date: Sep 2012
Posts: 1
Default Temples and very long checks (trapper? agent?)

I have a ruby script that runs some simple statistics via a MySQL connection, and on some larger databases, they may take ~10 seconds, but assume that under heavy load, they can take a minute or so. Here's my predicament as it currently stands (and please call me out if anything here is incorrect):

If I use a UserParameter and zabbix_get, I get "ZBX_NOTSUPPORTED" on the long ones. The #zabbix channel on Freenode suggested that I use zabbix_sender to push the results directly to a trapper, however...

If I use a sender/trapper, I can't seem to create universally-unique templates. On the server (via the web interface), I need to have a unique identifier in "Key", and it apparently doesn't take macros, so this means a couple dozen items across about a hundred agents. Not maintainable

Any suggestion on what to do here?
Reply With Quote
  #2  
Old 21-09-2012, 16:15
Yello Yello is offline
Senior Member
 
Join Date: Apr 2011
Posts: 309
Default

Quote:
Originally Posted by Synthead View Post

If I use a sender/trapper, I can't seem to create universally-unique templates. On the server (via the web interface), I need to have a unique identifier in "Key", and it apparently doesn't take macros, so this means a couple dozen items across about a hundred agents. Not maintainable

Any suggestion on what to do here?
Couple of dozen? Is that all? The key only has to be unique to each host. So, if you template it you can apply the same config to each host.

If you do actually need to do large scale provisioning then look at using the api.

Regards,
David
Reply With Quote
  #3  
Old 21-09-2012, 17:23
mbsit mbsit is offline
Senior Member
 
Join Date: Sep 2012
Location: Warszawa, Poland
Posts: 129
Send a message via Skype™ to mbsit
Lightbulb

Yello, has right.

You have to have uniqe Key only inside one Template.

Your sender script should looks like this:

# pseudo script

SQL='get statistics from SQL table"

from row=1 to the_end do
{
HOSTNAME=column[1]
KEY=column[2]
VALUE=column[3]
zabbix_sender -z $SERVER -s $HOSTNAME -k $KEY -v $VALUE
}

Zabbix sender is awesome utility, this is only simple example.

Best,
Grzegorz
Reply With Quote
Reply

Tags
agent, key, sender, trapper, zabbix

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:29.