Announcement

Collapse
No announcement yet.

Implementing an sql query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Implementing an sql query

    Good day,

    Again , guys i want to implement an sql Date query , something like this

    SELECT * FROM `dt_tb` WHERE month(dt) between '02' and '08' and year(dt) between 2004 and 2005

    My question is where do i place this query in nagios? is there a gui tab i click on and just put the line in it?

    Would very muc appreciate your help.

    Thanks

  • #2
    I don't understand your needs !

    Why do you want to execute SQL query in Nagios ?
    Centreon Syslog Module Manager/Developper
    Centreon E2S Module Manager/Developper
    Centreon Enterprise Server (2.x / 3.x) : Centreon Engine 1.3.x / 1.4.x, Centreon Broker 2.6.x / 2.8.x , Centreon 2.x, Centreon-Syslog 1.5.x, Centreon E2S 2.0
    Nagios 3.x et NDOutil 1.x

    Comment


    • #3
      I want to execute it in Nagios as i want to check on the stats of it through Nagios. is it possible?


      To make myself more clear ,The company i work with has an SMS server , where they want to implement some SQL quires into your system aka "Nagios". This is why am asking.

      Thanks

      Comment


      • #4
        You can do this :

        You create a Nagios's plugin (Like a php, perl or C file) with your query and an output of your data.

        Then, add a Nagios command with /usr/bin/php in prefix and your php file after (in case of php file)
        When Nagios will execute this Command, you will obtain your results as output.

        Comment


        • #5
          Originally posted by vince122 View Post
          You can do this :

          You create a Nagios's plugin (Like a php, perl or C file) with your query and an output of your data.

          Then, add a Nagios command with /usr/bin/php in prefix and your php file after (in case of php file)
          When Nagios will execute this Command, you will obtain your results as output.
          aHA, ok a quick question if you dont mind, when you say plugin , do you mean commands, like the pic i posted below ?

          http://i.imgur.com/rTVk8.jpg


          if not would you please post the steps.

          thanks


          EDIT: found the plugin tab on the mid left , but theres no add file
          Last edited by waelkd; 4th May 2012, 13:34.

          Comment


          • #6
            Yes, this page corresponds to Nagios commands.

            But before adding it here, you have to go to the Nagios's directory named "libexec" this is where you'll have all your "plugins" (plugin is only the executable file).
            In this directory, you can create an executable file with your query.

            After you created this file, and it works, you go to the Commands page (your screenshot), and you add the file you previously created.

            Comment


            • #7
              Originally posted by vince122 View Post
              Yes, this page corresponds to Nagios commands.

              But before adding it here, you have to go to the Nagios's directory named "libexec" this is where you'll have all your "plugins" (plugin is only the executable file).
              In this directory, you can create an executable file with your query.

              After you created this file, and it works, you go to the Commands page (your screenshot), and you add the file you previously created.

              cant find libexec, mind pointing me to it?

              Comment


              • #8
                find / -name libexec -type d

                Comment


                • #9
                  Originally posted by vince122 View Post
                  find / -name libexec -type d
                  i am a bit lost here, the link i use only displays gui, there's no command line or terminal to execute your / -name libexec -type d.


                  sorry am asking so many questions , but am very new to this

                  Comment

                  Working...
                  X