Ad Widget

Collapse

Custom defined items causing server to be unreachable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • [JiF]Mike
    Junior Member
    • Sep 2004
    • 14

    #1

    Custom defined items causing server to be unreachable

    I have the agent running on 3 servers. One of my servers has a few custom items to check that I defined in the config file. These custom items call a simple sh script that checks for the number of players on a game server and returns that number. However if the checked game server is not running, I get an unreachable status of the server doing the checking. If I shutdown the agent and comment out that custom line in the config file (or deactivate it via the zabbix web page) the server is again reachable. While in this unreachable state though, no other values are recorded. It's been kind of a pain in the butt, and I don't really understand why one item simply not returning any value would cause the entire server to appear unreachable, when in fact it is. I'm guessing I could change my sh script to always return a 0 value if no value is returned, but I'm not real good at writing scripts to do such things. Is there any other solution? Might I have somethiing configured wrong? This isn't a huge problem, just more of an annoyance. Thank you.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Return 0 when the game server is down. The problem is that your script doesn't return anything back to ZABBIX agent, therefore the agent thinks that your script failed. Why call failed script over and over again? ZABBIX is smart, so it protects himself by setting item status to UNREACHABLE. Everything is fine. Life is good!
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • [JiF]Mike
      Junior Member
      • Sep 2004
      • 14

      #3
      If it just disabled that one item I wouldn't mind. However no item data is recorded as it thinks the entire server is unreachable. This is kind of pointless now though. After I posted I thought it was time to learn a little about script programming, so I dove into a few tutorials. I've programmed in other languages so I just needed to get the structures down. It's a little odd and still easily confuses me, but now I have it returning a negative one when the server is down. So a trigger now informs me when the server is down. So far it seems to be working fairly well even with the downed servers. Here's a link to the graph, it's very handy for trend analysis. If anyone else would like to set this up, I'd be happy to share my scripts, though they are very simple.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Has to be fixed

        My previous post was not fully correct.

        Indeed, ZABBIX does change status of User Parameter to UNSUPPORTED in case if it receives empty (zero length) string from executed command.

        However, if the command returns empty line ('\n') then agent sends it to ZABBIX server and ZABBIX server will set host status to UNREACHABLE. This has to be fixed, and it will be fixed very soon.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          Let me know if you're interested in the fix, so I could publish it here.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • [JiF]Mike
            Junior Member
            • Sep 2004
            • 14

            #6
            Yes I am interested.

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              The patch

              Code:
              src/zabbix_agent/sysinfo.c:
               
               2188,2192d2187
               <	   if(c[0]=='\n')
               <	   {
               <			   return NULL;
               <	   }
               < 
               2237,2241d2231
               <	   if(c[0]=='\n')
               <	   {
               <			   return NULL;
               <	   }
               <
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              Working...