Dear All I am using a centos server for cdr billing and mediation device on a remote network. I am experiencing problem that I am suspicious it comes from main supply power cut at the remote site. The power supply to the remote site comes from battery charger that will be automatically switched in circuit under main supply power cut but cannot provide adequate power for more than 2 hours . I am suspicious that the remote system is suffering from many frequent main supply power cut . Can you please do me favor and let me know if there is any log on my centos server that I can check to see if there would be many frequent power cut there ? Thank you for your time
On 10/29/2016 10:12 PM, Hadi Motamedi wrote:> I am using a centos server for cdr billing and mediation device on a remote > network. I am experiencing problem that I am suspicious it comes from main > supply power cut at the remote site. The power supply to the remote site > comes from battery charger that will be automatically switched in circuit > under main supply power cut but cannot provide adequate power for more than > 2 hours . I am suspicious that the remote system is suffering from many > frequent main supply power cut . Can you please do me favor and let me know > if there is any log on my centos server that I can check to see if there > would be many frequent power cut there ?look at /var/log/messages for reboots without shutdowns. centos 6 linux boot starts logging something like... Oct 25 15:01:25 new kernel: imklog 5.8.10, log source = /proc/kmsg started. Oct 25 15:01:25 new rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="2740" x-info="http://www.rsyslog.com"] start Oct 25 15:01:25 new kernel: Initializing cgroup subsys cpuset Oct 25 15:01:25 new kernel: Initializing cgroup subsys cpu Oct 25 15:01:25 new kernel: Linux version 2.6.32-642.6.1.el6.x86_64 (mockbuild at worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Wed Oct 5 00:36:12 UTC 2016 followed by tons more about all the stuff starting up.... when its properly shutdown, you'd see something like this after everything has stopped Oct 25 14:20:36 new init: Disconnected from system bus Oct 25 14:20:38 new rpcbind: rpcbind terminating on signal. Restart with "rpcbind -w" Oct 25 14:20:38 new auditd[2704]: The audit daemon is exiting. Oct 25 14:20:38 new kernel: type=1305 audit(1477430438.399:37765): audit_pid=0 old=2704 auid=4294967295 ses=4294967295 res=1 Oct 25 14:20:38 new kernel: type=1305 audit(1477430438.497:37766): audit_enabled=0 old=1 auid=4294967295 ses=4294967295 res=1 Oct 25 14:20:38 new kernel: Kernel logging (proc) stopped. Oct 25 14:20:38 new rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="2738" x-info="http://www.rsyslog.com"] exiting on signal 15. if its booted without a clean shutdown, it will do some file system checking and such while starting. -- john r pierce, recycling bits in santa cruz
you could use smart ups and connect information from it to system, so it can shutdown system in clean way. Eero 2016-10-30 7:12 GMT+02:00 Hadi Motamedi <motamedi24 at gmail.com>:> Dear All > I am using a centos server for cdr billing and mediation device on a remote > network. I am experiencing problem that I am suspicious it comes from main > supply power cut at the remote site. The power supply to the remote site > comes from battery charger that will be automatically switched in circuit > under main supply power cut but cannot provide adequate power for more than > 2 hours . I am suspicious that the remote system is suffering from many > frequent main supply power cut . Can you please do me favor and let me know > if there is any log on my centos server that I can check to see if there > would be many frequent power cut there ? > Thank you for your time > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
Thank you very much for your reply . So you mean under the /var/log/messages it is distinguishable that which logs come from operator initiated reboot and which ones come from sudden power cut and then booting from scratch when power resumed ? Am I correct ? On Sat, Oct 29, 2016 at 11:44 PM, John R Pierce <pierce at hogranch.com> wrote:> On 10/29/2016 10:12 PM, Hadi Motamedi wrote: > >> I am using a centos server for cdr billing and mediation device on a >> remote >> network. I am experiencing problem that I am suspicious it comes from main >> supply power cut at the remote site. The power supply to the remote site >> comes from battery charger that will be automatically switched in circuit >> under main supply power cut but cannot provide adequate power for more >> than >> 2 hours . I am suspicious that the remote system is suffering from many >> frequent main supply power cut . Can you please do me favor and let me >> know >> if there is any log on my centos server that I can check to see if there >> would be many frequent power cut there ? >> > > look at /var/log/messages for reboots without shutdowns. > > centos 6 linux boot starts logging something like... > > Oct 25 15:01:25 new kernel: imklog 5.8.10, log source = /proc/kmsg started. > Oct 25 15:01:25 new rsyslogd: [origin software="rsyslogd" > swVersion="5.8.10" x-pid="2740" x-info="http://www.rsyslog.com"] start > Oct 25 15:01:25 new kernel: Initializing cgroup subsys cpuset > Oct 25 15:01:25 new kernel: Initializing cgroup subsys cpu > Oct 25 15:01:25 new kernel: Linux version 2.6.32-642.6.1.el6.x86_64 ( > mockbuild at worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat > 4.4.7-17) (GCC) ) #1 SMP Wed Oct 5 00:36:12 UTC 2016 > > > followed by tons more about all the stuff starting up.... > > > when its properly shutdown, you'd see something like this after everything > has stopped > > Oct 25 14:20:36 new init: Disconnected from system bus > Oct 25 14:20:38 new rpcbind: rpcbind terminating on signal. Restart with > "rpcbind -w" > Oct 25 14:20:38 new auditd[2704]: The audit daemon is exiting. > Oct 25 14:20:38 new kernel: type=1305 audit(1477430438.399:37765): > audit_pid=0 old=2704 auid=4294967295 ses=4294967295 res=1 > Oct 25 14:20:38 new kernel: type=1305 audit(1477430438.497:37766): > audit_enabled=0 old=1 auid=4294967295 ses=4294967295 res=1 > Oct 25 14:20:38 new kernel: Kernel logging (proc) stopped. > Oct 25 14:20:38 new rsyslogd: [origin software="rsyslogd" > swVersion="5.8.10" x-pid="2738" x-info="http://www.rsyslog.com"] exiting > on signal 15. > > > if its booted without a clean shutdown, it will do some file system > checking and such while starting. > > > -- > john r pierce, recycling bits in santa cruz > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
Thank you for your reply. You are correct and the ups is present there but the battery charger can no longer bear power cuts more than two hours so I need some means to distinguish frequent power cuts there among the system logs. On Sun, Oct 30, 2016 at 12:02 AM, Eero Volotinen <eero.volotinen at iki.fi> wrote:> you could use smart ups and connect information from it to system, so it > can shutdown system in clean way. > > Eero > > 2016-10-30 7:12 GMT+02:00 Hadi Motamedi <motamedi24 at gmail.com>: > > > Dear All > > I am using a centos server for cdr billing and mediation device on a > remote > > network. I am experiencing problem that I am suspicious it comes from > main > > supply power cut at the remote site. The power supply to the remote site > > comes from battery charger that will be automatically switched in circuit > > under main supply power cut but cannot provide adequate power for more > than > > 2 hours . I am suspicious that the remote system is suffering from many > > frequent main supply power cut . Can you please do me favor and let me > know > > if there is any log on my centos server that I can check to see if there > > would be many frequent power cut there ? > > Thank you for your time > > _______________________________________________ > > CentOS mailing list > > CentOS at centos.org > > https://lists.centos.org/mailman/listinfo/centos > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
On 10/30/2016 01:12 AM, Hadi Motamedi wrote:> Dear All > I am using a centos server for cdr billing and mediation device on a remote > network. I am experiencing problem that I am suspicious it comes from main > supply power cut at the remote site. The power supply to the remote site > comes from battery charger that will be automatically switched in circuit > under main supply power cut but cannot provide adequate power for more than > 2 hours . I am suspicious that the remote system is suffering from many > frequent main supply power cut . Can you please do me favor and let me know > if there is any log on my centos server that I can check to see if there > would be many frequent power cut there ? > Thank you for your timeI have been experiencing a similar situation with a remote server, and found it much easier to use the command: last -x | tail -n50 to see reboots. You can tell a power cut because the end time for the previous boot up will be the same as the begin time for the next boot. If it is an orderly shutdown, there will be a time gap that is logged. As I understand it, the 'last' command uses the data stored in /var/log/wtmp, but that information is not in human-readable format. Ted Miller Indiana, USA
Hello Hadi, On Sat, 2016-10-29 at 22:12 -0700, Hadi Motamedi wrote:> I am suspicious that the remote system is suffering from many > frequent main supply power cut . Can you please do me favor and let me know > if there is any log on my centos server that I can check to see if there > would be many frequent power cut there ?People have already pointed you to dmesg and /var/log/messages. To receive an email every time it gets rebooted put the below lines in /etc/rc.d/rc.local (or wrap them in a script and add a reference to that): mail -s "Server <name> rebooted" you at example.com << ENDOFMESSAGE Server <name> has been rebooted. ENDOFMESSAGE This of course will only notify you after the fact and will be no good if the system stays down. Regards, Leonard. -- mount -t life -o ro /dev/dna /genetic/research
Don't know how much control you have over the remote situation but some UPSes have their own logs which should show this. Also, some UPSes have add-in boards providing network connections with various services. If these outages are costing enough money and the remote UPS doesn't have the add-in card but does have the capability of adding one you might be able to justify the expense. ----- Original Message ----- From: "Ted Miller" <centos-user at millert.e4ward.com> To: centos at centos.org, "Hadi Motamedi" <motamedi24 at gmail.com> Sent: Tuesday, November 1, 2016 8:00:48 PM Subject: Re: [CentOS] Power Cut On 10/30/2016 01:12 AM, Hadi Motamedi wrote:> Dear All > I am using a centos server for cdr billing and mediation device on a remote > network. I am experiencing problem that I am suspicious it comes from main > supply power cut at the remote site. The power supply to the remote site > comes from battery charger that will be automatically switched in circuit > under main supply power cut but cannot provide adequate power for more than > 2 hours . I am suspicious that the remote system is suffering from many > frequent main supply power cut . Can you please do me favor and let me know > if there is any log on my centos server that I can check to see if there > would be many frequent power cut there ? > Thank you for your timeI have been experiencing a similar situation with a remote server, and found it much easier to use the command: last -x | tail -n50 to see reboots. You can tell a power cut because the end time for the previous boot up will be the same as the begin time for the next boot. If it is an orderly shutdown, there will be a time gap that is logged. As I understand it, the 'last' command uses the data stored in /var/log/wtmp, but that information is not in human-readable format. Ted Miller Indiana, USA _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos