Ad Widget

Collapse

monitoring process only if run with specific arguments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilia
    Member
    • Dec 2018
    • 37

    #1

    monitoring process only if run with specific arguments

    i am trying to monitor process only if it running with specific set of arguments that passed to him, is it possible?

    currently i am monitoring using proc.num[ProcesssName]
  • ilia
    Member
    • Dec 2018
    • 37

    #2
    anyone got an idea how to do it?

    Comment

    • gert.derouck
      Member
      • Jan 2020
      • 69

      #3
      Hi Ilia,
      on which OS you want to check for this specific process?
      You can use some user parameter?
      Some thing like:
      UserParameter=os.process[*],ps -ef |grep '$1'

      Regards
      Gert

      Comment

      • ilia
        Member
        • Dec 2018
        • 37

        #4
        Originally posted by gert.derouck
        Hi Ilia,
        on which OS you want to check for this specific process?
        Gert
        Centos 7

        Originally posted by gert.derouck
        Hi Ilia,

        You can use some user parameter?
        Some thing like:
        UserParameter=os.process[*],ps -ef |grep '$1'
        Gert
        how does it help?

        i have a process, if it run like this run -A i want to monitor it and trigger upon crash
        and if it run with another argument like run -B i dont want to monitor it

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          What does "monitoring the process" mean to you?

          Comment

          • tim.mooney
            Senior Member
            • Dec 2012
            • 1427

            #6
            Originally posted by ilia
            i am trying to monitor process only if it running with specific set of arguments that passed to him, is it possible?
            Are you saying that the 4th argument to proc.num[] doesn't do what you need?

            Code:
            proc.num[<name>,<user>,<state>,<cmdline>,<zone>]

            Comment

            • ilia
              Member
              • Dec 2018
              • 37

              #7
              Originally posted by Hamardaban
              What does "monitoring the process" mean to you?
              i am trying to signal a notification only when the process that started with specific argument crashed. or return to normal state after crash

              Originally posted by tim.mooney

              Are you saying that the 4th argument to proc.num[] doesn't do what you need?

              Code:
              proc.num[<name>,<user>,<state>,<cmdline>,<zone>]
              i didnt know about it,
              ​​​​​​​ill give it a try

              Comment

              • ilia
                Member
                • Dec 2018
                • 37

                #8
                Originally posted by tim.mooney

                Are you saying that the 4th argument to proc.num[] doesn't do what you need?

                Code:
                proc.num[<name>,<user>,<state>,<cmdline>,<zone>]
                it worked, thanks

                Comment

                Working...