Ad Widget

Collapse

Performance: External Check vs Cron

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artesvida
    Junior Member
    • May 2007
    • 18

    #1

    Performance: External Check vs Cron

    Following some advice in the forum, I am now monitoring latency in my WAN links. I decided to use a cron job, which gets the latency for each link then sends it off to Zabbix using zabbix_sender. I'm thinking of using external checks instead, but the manual warns:
    Note: Do not overuse external checks! It can decrease performance for ZABBIX system very much.
    So, all other things being equal, which has a larger performance hit: running a script via an external check, or running the script via cron and sending the data to zabbix?

    I know I shouldn't worry, because I only have 3 WAN links that I'm checking on. But my system is old and slow and I want to do all that I can to keep it lightly loaded.
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    I don't know what is best performance wise, but you should be aware with using cron jobs, that you could be writing to the output file, while the zabbix agent is trying to read it, which could lead to unexpected results. You should be aware of this when designing the script to run

    Comment

    • cstackpole
      Senior Member
      Zabbix Certified Specialist
      • Oct 2006
      • 225

      #3
      Originally posted by Tenzer
      ...you could be writing to the output file, while the zabbix agent is trying to read it, which could lead to unexpected results.
      While I have not had this problem with the log files I monitor, one way to make sure you don't have this problem is to use a trapper event and just send the result to zabbix directly. I do this all of the time. I just slap into my script code a:
      Code:
      /usr/sbin/zabbix_sender -z $zabbixserver -p $zabbixport -s $hostname -k $key -o $value
      Quick and easy. I monitor a lot of stuff this way, but that is me. YMMV.

      Hope this gives you an idea for your solution.

      Have fun!

      [EDIT]
      Rats..I forgot to mention something...
      Originally posted by artesvida
      So, all other things being equal, which has a larger performance hit: running a script via an external check, or running the script via cron and sending the data to zabbix?
      I do both depending on the situation. I have not noticed a significant difference between the two. I do use both of them though for different reasons.

      If I have something that needs to be run at a certain time of day, I use cron. That is what it is there for.

      If I have something that I need to ensure is running at a certain time of day (regardless of how it was started or by who, the process just needs to be running) I use Zabbix to monitor the process and if it is off then I have Zabbix start it with the script. I could have a script in cron that simply says:
      Is it started? If yes, do nothing. If no, start it.
      But by using Zabbix I have a record and history and is the way I prefer to have it.
      Last edited by cstackpole; 23-05-2008, 15:22. Reason: Forgot to mention....

      Comment

      Working...