Home>
I want to achieve

https://www.tutorialfor.com/go.php?id=245197
Asked Cron every morning to see if the service was working properly
Set to /usr/bin/ping_alert.sh.

Every morning, emails arrived during normal operation.

However, I did not receive an email this morning. (If it's not running, I'm going to set up an email titled "Alert of server down".)
The cause seems to be that the network or power supply of the department where the virtual machine where the server is located is stopped.

In this way, if power supply is suddenly interrupted, is it not enough for cron to skip mail?
Should I check or change the settings?

  • Answer # 1

    In this way, if power supply is suddenly interrupted, is it not enough for cron to skip mail?

      

    Yes, server goes down on the spot = OS goes down on the spot = cron doesn't work

    Should I check or change the settings?

      

    Install a UPS (Uninterruptible Device) if you do not want to bring down the server immediately even if the power supply is cut off
      Monitor the server from outside if you want to see immediately if the server is dead

  • Answer # 2

      

    In this way, if power supply is suddenly interrupted, is it not enough for cron to skip mail?

    Same as unplugging the power cord&network equipment will also die if the power is turned off and there is no route, even if the OS skips mail.

      

    Should I check or change the settings?

    What you can do depends on the duration and range of the power interruption. For a momentary power failure or a power outage of a few minutes, adding a UPS will do a great deal, but a power outage that lasts longer like a statutory power outage inspection may require a generator.


    The low initial cost

    Every morning, additional settings are made to skip mails with or without errors

    Is not it.
    in this case,
    From the operation that says an error if the mail has arrived → Check the title of the mail and determine the error. Judge as abnormal if no email
    Operation cost increases.

    If you want to do better, you can prepare an external monitoring server (or contract with a monitoring service) and keep it in constant communication with the monitoring server, so that if a problem occurs, you can set up the server to send mail.

    Even if it is a server on the internal network, any monitoring tool that installs an agent can communicate with the monitoring server and monitoring service on the Internet, so it is necessary to prepare a highly available monitoring server and service on the cloud. You can feel safe (although permission from the internal network administrator is required)

  • Answer # 3

    How about one of the following actions
    -It is assumed that the mail arrives as normal operation, and if it does not come, it does not work
    ・ Skip the ping from the other server to the target server and mail the result

    It is one hand to use monitoring software. Zabbix is ​​often used.