Ad Widget

Collapse

Number of running processes = 0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wbro1
    Junior Member
    • Apr 2009
    • 17

    #16
    OESstatus rcnovell-ncs 15 May 14:01:13 0
    OESstatus rcnovell-nss 15 May 14:01:12 3

    this is the result with your parameters added.

    Comment

    • richlv
      Senior Member
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Oct 2005
      • 3112

      #17
      that part you removed discards any output to stdout or stderr and returns exit code to stdout.
      most initscripts propery exit with code 0 when everything's successful & running, and some other code to indicate other states. so in the trigger you could simply check for #0 to detect that a service is not running.
      of course, if service will decide to silently die and initscript will think it's all ok, that's what the command will return, obviously
      Zabbix 3.0 Network Monitoring book

      Comment

      • wbro1
        Junior Member
        • Apr 2009
        • 17

        #18
        Thanks a lot for your service in helping us out here.
        My output in latest values looks now like below, I gues I must retrieve the statuscode discriptions from novell forums ?

        OESstatus rcnovell-ncs 15 May 14:37:19 0
        OESstatus rcnovell-nss 15 May 14:36:59 3
        OESstatus rcnovell-tomcat5 15 May 14:35:40 0
        OESstatus rcnovell-ipsmd 15 May 14:36:45 126
        OESstatus rcntp 15 May 14:35:56 101
        OESstatus rcnovell-zmd 15 May 14:36:14 127
        OESstatus rcapache2 15 May 14:36:58 126
        OESstatus rccron 15 May 14:36:58 126
        OESstatus rcndsd 15 May 14:35:54 0
        OESstatus rcnovell-httpstkd 15 May 14:35:41 1
        OESstatus rcnovell-idsd 15 May 14:37:19 126
        OESstatus rcnovell-smdrd 15 May 14:36:06 0
        OESstatus rcnovell-xregd 15 May 14:35:59 0
        OESstatus rcnovell-xsrvd 15 May 14:36:35 0
        OESstatus rcnscd 15 May 14:37:04 101
        OESstatus rcowcimomd 15 May 14:36:45 1
        OESstatus rcslpd 15 May 14:35:49 101
        OESstatus rcnxdrvd 15 May 14:35:36 127

        Comment

        • richlv
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2005
          • 3112

          #19
          that depends on how much you are interested in those. if you just want to know running/no, checking whether it's 0 would suffice, otherwise, yes, you should somehow find out what return codes are
          Zabbix 3.0 Network Monitoring book

          Comment

          • wbro1
            Junior Member
            • Apr 2009
            • 17

            #20
            Thanks again richlv

            Comment

            • wbro1
              Junior Member
              • Apr 2009
              • 17

              #21
              echo $? results differ in zabbix

              From Linux commandline I get result below

              CN02:/etc/init.d # /etc/init.d/cron status >/dev/null 2>&1; echo $?
              0

              Same thing in Zabbix results in exitcode 126

              UserParameter=OESstatus[*],$1 status >/dev/null 2>&1; echo $?

              OESstatus[/etc/init.d/cron]

              OESstatus /etc/init.d/cron 19 May 14:55:08 126

              Comment

              • richlv
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2005
                • 3112

                #22
                because zabbix user does not have the rights to execute the script. you can try adding ability to launch "/etc/init.d/cron status" for zabbix in sudoers
                Zabbix 3.0 Network Monitoring book

                Comment

                • wbro1
                  Junior Member
                  • Apr 2009
                  • 17

                  #23
                  Perfect,

                  just added :
                  zabbix ALL=NOPASSWD: /etc/init.d/cron status

                  Now Zabbix returns a exitcode 0.

                  Thanks again.

                  Comment

                  Working...