Ad Widget

Collapse

Trigger with a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thefuzz4
    Junior Member
    • Feb 2015
    • 16

    #1

    Trigger with a string

    Hey Everyone,

    So I'm trying to setup a trigger for crashplan. I have a userpreference script that runs and asks crashplan what its status is. I have a grep in that statement that just looks for running

    Code:
    UserParameter=crash.running,su - root -c '/usr/pbi/crashplan-amd64/share/crashplan/bin/CrashPlanEngine status' | grep 'running' | awk '{print $NF}'
    Nothing too fancy. It returns a value back to zabbix of running and all is happy in the world.

    Now what I want to do is if crashplan isn't running it returns back an empty string. How can I create a trigger that when it sees anything else other than running for it to fire off.

    I created a trigger based off of another thread that looks like this
    Code:
    {crashplan_1:crash.running.str()}=1
    But since its currently alarming that crashplan is not running (even though it is) I know that my trigger isn't working properly. Thanks.
  • jamesNJ
    Senior Member
    • Jun 2015
    • 103

    #2
    I think what you want to use is something like this:

    {crashplan_1:crash.running.str("running")}=0

    Which will trigger if the value is not "running". Else you might try:

    {crashplan_1:crash.running.nodata()}=1

    Comment

    • thefuzz4
      Junior Member
      • Feb 2015
      • 16

      #3
      Thank you that did the trick. Greatly appreciated.

      Comment

      • jamesNJ
        Senior Member
        • Jun 2015
        • 103

        #4
        I'm glad it worked! I learned something as well looking into this

        Comment

        Working...