Monit: Customize alert message to include command outputSending a test/example alert from monit?Suppress...

Should the Product Owner dictate what info the UI needs to display?

Was Dennis Ritchie being too modest in this quote about C and Pascal?

How do I check if a string is entirely made of the same substring?

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

How to have a sharp product image?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Nails holding drywall

Mistake in years of experience in resume?

My admission is revoked after accepting the admission offer

Island of Knights, Knaves and Spies

A strange hotel

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

Is Electric Central Heating worth it if using Solar Panels?

Magical attacks and overcoming damage resistance

How to not starve gigantic beasts

Is there any pythonic way to find average of specific tuple elements in array?

Multiple options vs single option UI

What *exactly* is electrical current, voltage, and resistance?

Could moose/elk survive in the Amazon forest?

std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?

How to pronounce 'c++' in Spanish

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

How exactly does Hawking radiation decrease the mass of black holes?

What was Apollo 13's "Little Jolt" after MECO?



Monit: Customize alert message to include command output


Sending a test/example alert from monit?Suppress Monit message 'Monit instance changed' on stop/startMonit failing to connect to Dovecot over SSL IMAPmonit: how send email like alertMonit - send alert if mailserver downHow to restart and alert if condition matches in Monit?Monit Alert with Multiple URLsMonit use alert along with execAlert on simultaneous failure of multiple monit servicesThe curious case of high 5 min load average






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I would like to customize the Monit's alert message, so that whenever I get an alert, the email also includes the output of a command like top, so that I will already know more details about what might have caused the problem.



Is there a way to do this? The documentation doesn't include anything relevant, and searching wasn't helpful either.



Thanks for the help!










share|improve this question































    2















    I would like to customize the Monit's alert message, so that whenever I get an alert, the email also includes the output of a command like top, so that I will already know more details about what might have caused the problem.



    Is there a way to do this? The documentation doesn't include anything relevant, and searching wasn't helpful either.



    Thanks for the help!










    share|improve this question



























      2












      2








      2


      4






      I would like to customize the Monit's alert message, so that whenever I get an alert, the email also includes the output of a command like top, so that I will already know more details about what might have caused the problem.



      Is there a way to do this? The documentation doesn't include anything relevant, and searching wasn't helpful either.



      Thanks for the help!










      share|improve this question
















      I would like to customize the Monit's alert message, so that whenever I get an alert, the email also includes the output of a command like top, so that I will already know more details about what might have caused the problem.



      Is there a way to do this? The documentation doesn't include anything relevant, and searching wasn't helpful either.



      Thanks for the help!







      linux monitoring monit






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago









      Michael Hampton

      176k27321651




      176k27321651










      asked Dec 16 '11 at 9:36









      Charalambos PaschalidesCharalambos Paschalides

      12114




      12114






















          1 Answer
          1






          active

          oldest

          votes


















          5














          How about something like this, from the monit wiki?



          # Getting top otput by mail on event
          check file myfile with path /tmp/fo.bar
          if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"


          Link: http://mmonit.com/wiki/Monit/ConfigurationExamples
          (scroll to very bottom)






          share|improve this answer
























          • Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

            – Charalambos Paschalides
            Feb 28 '12 at 15:19














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f341547%2fmonit-customize-alert-message-to-include-command-output%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          How about something like this, from the monit wiki?



          # Getting top otput by mail on event
          check file myfile with path /tmp/fo.bar
          if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"


          Link: http://mmonit.com/wiki/Monit/ConfigurationExamples
          (scroll to very bottom)






          share|improve this answer
























          • Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

            – Charalambos Paschalides
            Feb 28 '12 at 15:19


















          5














          How about something like this, from the monit wiki?



          # Getting top otput by mail on event
          check file myfile with path /tmp/fo.bar
          if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"


          Link: http://mmonit.com/wiki/Monit/ConfigurationExamples
          (scroll to very bottom)






          share|improve this answer
























          • Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

            – Charalambos Paschalides
            Feb 28 '12 at 15:19
















          5












          5








          5







          How about something like this, from the monit wiki?



          # Getting top otput by mail on event
          check file myfile with path /tmp/fo.bar
          if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"


          Link: http://mmonit.com/wiki/Monit/ConfigurationExamples
          (scroll to very bottom)






          share|improve this answer













          How about something like this, from the monit wiki?



          # Getting top otput by mail on event
          check file myfile with path /tmp/fo.bar
          if changed timestamp then exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"


          Link: http://mmonit.com/wiki/Monit/ConfigurationExamples
          (scroll to very bottom)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 23 '12 at 22:03









          HenryHenry

          5112




          5112













          • Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

            – Charalambos Paschalides
            Feb 28 '12 at 15:19





















          • Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

            – Charalambos Paschalides
            Feb 28 '12 at 15:19



















          Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

          – Charalambos Paschalides
          Feb 28 '12 at 15:19







          Henry, I would have preferred a more "centralized" solution, that would enable me to add top's output in the mail-format parameter, so that I would get it in every mail alert sent. From what I read though, this is impossible. Your solution is an excellent workaround though!

          – Charalambos Paschalides
          Feb 28 '12 at 15:19




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f341547%2fmonit-customize-alert-message-to-include-command-output%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...