Ad Widget

Collapse

check one daemon

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nima0102
    Senior Member
    • May 2010
    • 106

    #1

    check one daemon

    Hi
    I have to check whether one daemon is running or not.if not then run one script.
    I have confused for configuring for this purpose.
    Thanks for any help or guidance
  • nima0102
    Senior Member
    • May 2010
    • 106

    #2
    Originally posted by nima0102
    Hi
    I have to check whether one daemon is running or not.if not then run one script.
    I have confused for configuring for this purpose.
    Thanks for any help or guidance
    Hi again
    Is there any help or recommendation for my purpose ??

    Thanks in advance

    Comment

    • tchjts1
      Senior Member
      • May 2008
      • 1605

      #3
      What are you confused about? How to configure the item to check for the daemon, or how to run the script if it is down?

      it is also helpful to specify what OS you are monitoring and what version of Zabbix you are running.

      Comment

      • nima0102
        Senior Member
        • May 2010
        • 106

        #4
        Hi
        Thanks for your attention
        I am confused on 2 cases you mentioned.you completely got my mean
        1- How to configure the item to check for the daemon
        2- how to run the script if it is down

        Thanks for more help or guidance

        Comment

        • tchjts1
          Senior Member
          • May 2008
          • 1605

          #5
          For determining if the daemon is up, you should be able to use proc.num[] With the name of the process or daemon in the brackets.

          Attached is a screenshot of the item config for us to know if a DataStage daemon is running or not. Same type of item used to tell you if http is running or not.

          I don't run any scripts in case of a daemon being down, so I can't help you there, but you would probably need to enable remote commands option in the hosts zabbix_agentd.conf file to run the script.

          The way we do it where I work is to set up an alert (Action) that the daemon is down, and the application owner gets the alert and it is on them to determine what the problem is and to fix it.

          Note that "Type" will work fine whether it is Zabbix agent or Zabbix agent (Active).
          Attached Files

          Comment

          • nima0102
            Senior Member
            • May 2010
            • 106

            #6
            Thanks for your good reply.
            I have added new item "proc.num[bbb]" on your instruction.
            I have one instance of our daemon on system and some another programs that have in own path name of this daemon so zabbix displays 3 on latest data that is not desirable result for checking daemon!
            For more clarify :
            I have one daemon bbb on system and other daemon ccc that be run from path /usr/bbb/ccc.
            If I run `ps -ax | grep bbb` I get 3 lines as result. I think zabbix uses this approach for counting daemons on system that is not suitable approach.

            Thanks for more guidance.

            Comment

            • bill.campbell
              Junior Member
              • Nov 2007
              • 3

              #7
              UserParameters

              Not sure since this is an old thread, but I've found the easiest way to monitor a daemon (if the daemon has a status command) is to create a UserParameter in the Zabbix configuration file, as below (this works for RHEL/CentOS systems, but similar logic can be applied for Debian/Ubuntu systems as well):

              UserParameter=bluetooth.status,/sbin/service bluetooth status | grep -c running

              grep -c will return the number of lines that have the text "running", and in most daemon status checks, this should return a 1.

              Create a service map to show 1=up, 0=down, and add the UserParameter to the key field. All done.
              Last edited by bill.campbell; 15-12-2011, 23:51.

              Comment

              • frankymryao
                Member
                • Oct 2011
                • 52

                #8
                Originally posted by bill.campbell
                Not sure since this is an old thread, but I've found the easiest way to monitor a daemon (if the daemon has a status command) is to create a UserParameter in the Zabbix configuration file, as below (this works for RHEL/CentOS systems, but similar logic can be applied for Debian/Ubuntu systems as well):

                UserParameter=bluetooth.status,/sbin/service bluetooth status | grep -c running

                grep -c will return the number of lines that have the text "running", and in most daemon status checks, this should return a 1.

                Create a service map to show 1=up, 0=down, and add the UserParameter to the key field. All done.
                I use this method, too. But a little to correct, the specific return value depends on specific environments. The best way to check is that stop the daemon and review the return value. It can make the most correct threshold for the item.

                Comment

                Working...