Results 1 to 2 of 2

Thread: Shell script: Mysql compare values

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile Shell script: Mysql compare values

    Hi Somit, Friends, Greeting.

    I am looking for a mysql query using nagios.
    I am able to get a numeric value using a custom script from mysql.
    now i need another bash script who will take value from my first script.
    conditions are, incase of that value is 0 then ok and >0 then is should say critical.

    Pls suggest.

    Regards,
    Rahul Janghel.

  2. #2
    Member billconner's Avatar
    Join Date
    Jul 2010
    Posts
    90
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    5

    Default

    Quote Originally Posted by rahuljanghel View Post
    Hi Somit, Friends, Greeting.

    I am looking for a mysql query using nagios.
    I am able to get a numeric value using a custom script from mysql.
    now i need another bash script who will take value from my first script.
    conditions are, incase of that value is 0 then ok and >0 then is should say critical.

    Pls suggest.

    Regards,
    Rahul Janghel.
    Use a case statement with the default value being to do nothing:

    case $i in
    0) echo "ok";;
    *) exit 0 ;;
    esasc

    Logic is the same for an if statement or while loop.

    Bill

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 6th November 2010, 08:23 AM
  2. Compare Float or Real Numbers in A shell Script
    By sweta in forum Shell scripting
    Replies: 2
    Last Post: 1st April 2010, 10:48 AM
  3. Replies: 2
    Last Post: 19th November 2009, 12:58 PM
  4. Shell scripting: How to compare float values
    By chanderbio in forum Shell scripting
    Replies: 1
    Last Post: 26th July 2007, 05:46 PM
  5. How can I Update the XML Tag Values using Shell Script
    By Mithun_Kamath in forum Shell scripting
    Replies: 1
    Last Post: 25th January 2007, 12:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •