Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Get last Shutdown date

Hello everyone,

how / where do I find information about the last shutdown on the Sophos?

Background info: our Sophos is connected to an UPS. If the ups is running on battery a script makes an SSH login and it should shut down the sophos (using shutdown command).
But I am not sure if that works so I want to check the last shutdown date or some logfiles which give me information about it.

Best regards
Christian


This thread was automatically locked due to age.
  • Hi ,


    You can login to login to sophos/utm box with ssh with loginuser then su and run command 

    last reboot or you can run
    last  |head -n 10 or you can run
    last last |head -n 5(can incress number for more report/dates) |grep -i sys


    with this command you can also check who login to your system @ what time 

    edit :reboot   system boot  3.12.30-123.g294 Sat Jul 18 10:59         (2+07:48) 
  • Hi
    and thanks for your post.

    From last reboot I've got the following results:
    loginuser:/home/login > date
    Tue Jul 21 08:31:51 CEST 2015
    loginuser:/home/login > last reboot
    reboot   system boot  3.12.30-123.g294 Sun Jul 19 11:40         (1+20:51)
    reboot   system boot  3.12.30-123.g294 Tue Jun 30 06:12         (21+02:19)
    (and many more)

    Can you help me with understanding the time shown on my output?

    I know that on Sun, Jul 19 there was a power outage in the morning and my shutdown script should shut down the sophos.
    So I guess there are 2 options. First: the shutdown was successfull and the last shutdown was somewhat between 5 and 6 o'clock or second: the shutdown was not successfull and the sophos was running until power from ups was depleted.

    That's the information I try to get from the last shutdown date.

    Regards
    Christian
  • Hi Christian. 

    I never try with ups but please read online help 
    "UPS Device Support

    Uninterruptible Power Supply (UPS) devices maintain a continuous supply of electric power to connected equipment by supplying power from a separate source when utility power is not available. Sophos UTM supports UPS devices of the manufacturers MGE UPS Systems and APC. The communication between the UPS device and Sophos UTM is made via the USBClosed interface.

    As soon as the UPS device runs in battery operation, a notification is sent to the administrator. If the power failure persists for a longer period and the voltage of the UPS device approximates a critical value, another message will be sent to the administrator—Sophos UTM will be shut down automatically.

    Note – Please read the operation manual of the UPS device to connect the devices to Sophos UTM. UTM will recognize the UPS device when booting via the USB interface. Only boot Sophos UTM when you have connected the USB interfaces to each other. "

    and 2nd thing is when you have around reboot/shutdown time you can go to system log to check wheter system was shutdown by regular process or it was just down/halt without proper shutdown now in my case here is log from "system log"

    /var/log/system/2015/07/system-2015-07-14.log.gz:2015:07:14-10:01:48 utm postgres[3558]: [3-1] LOG: received fast shutdown requestJul 14 10:01:48 postgres[3558]: [4-1] LOG: aborting any active transactions 

    if you have abnormal shutdown then there will be no this kind of log right( ?)

    hope this helps understanding ,if not please please lets know will try to explain it better again [:)]

    thanks
  • In the syslog is no entry regarding a shutdown or something similar.
    It just stops at 05:55:01. The next entry is at 11:41:13, regarding syslog-ng starting up.

    So I guess my shutdown didn't worked as expected.
    But at least I have now an information to look wether the shutdown was successful or not. Thanks [:)]

    By the way, Sophos UPS Device Support doesn't help in our environment.
  • Did i say syslog ? 

    system log /system message 

    please check images will give you idea about and try to follow /re-produce it with your system 

    there is another way check image two when you shutdown system properly it say down but when you shoutdown system not properly there is no down tag

    from 10 june to 19 jun i was away from home and my son shutdown host directly utm /sophos is guest on kvm  (check my system details @bottom of thread )
  • Sorry, with syslog I meant this folder: /var/log/system/2015/07/
    The search from your image1 showed just 1 entry:
    /var/log/system/2015/07/system-2015-07-19.log.gz:2015:07:19-11:44:49 fsp-astaro dhclient: Received signal 15, initiating shutdown.

    And the second one (using last?) does not show something with down, just logins and system boot (last 2 boot entries):

    reboot system boot 3.12.30-123.g294 Sun Jul 19 11:40 (1+20:51)
    reboot system boot 3.12.30-123.g294 Tue Jun 30 06:12 (21+02:19)
  • yes just last command 

    for shutdown time how many days data you fetch/selected you should select 1 month 

    if you pm me i can show you all details if your problem/understanding not FIX [:)][:D]
    thx
  • Well I selected just the last 7 days.
    But when I say I want to have the last 6 months I got some entries like them:
    /var/log/system/2015/06/system-2015-06-30.log.gz:2015:06:30-06:11:43 fsp-astaro postgres[3841]: [3-1] LOG: received fast shutdown requestJun 30 06:11:43 postgres[3841]: [4-1] LOG: aborting any active transactions 

    Gonna make a test the next days, then I can tell if anything went like it should.
  • Btw:when did you installed the system and how many times you have reboot/restart the system 

    which type of software/hardware appliance you are using
  • Sorry I didn't response earlier.
    We are using the UTM220 rev. 5 hardware. I only reboot for installing sophos updates.
    And, of course, when there was a power outage.

    Some minutes ago I tested again my shutdown script. Still got some problems with starting the command, but the command triggered itself is working.

    2015:07:24-07:06:23 Firewall init: Switching to runlevel: 0
    2015:07:24-07:06:39 Firewall ulogd[23429]: SIGTERM received
    2015:07:24-07:06:42 Firewall postgres[3824]: [3-1] LOG:  received fast shutdown requestJul 24 07:06:42 postgres[3824]: [4-1] LOG:  aborting any active transactions
    2015:07:24-07:06:42 Firewall postgres[32656]: [3-1] FATAL:  terminating connection due to administrator command
    2015:07:24-07:06:42 Firewall postgres[32594]: [3-1] FATAL:  terminating connection due to administrator command
    2015:07:24-07:06:42 Firewall postgres[32645]: [3-1] FATAL:  terminating connection due to administrator command
    2015:07:24-07:06:42 Firewall postgres[32595]: [3-1] FATAL:  terminating connection due to administrator command
    2015:07:20-15:09:56 Firewall postgres[3829]: [3-1] WARNING:  pgstat wait timeoutJul 24 07:06:42 postgres[3829]: [4-1] LOG:  autovacuum launcher shutting down
    2015:07:24-07:06:42 Firewall postgres[5167]: [3-1] FATAL:  terminating connection due to administrator command
    2015:07:24-07:06:42 Firewall postgres[3826]: [2-1] LOG:  shutting downJul 24 07:06:43 postgres[3826]: [3-1] LOG:  database system is shut down
    2015:07:24-07:06:47 Firewall syslog-ng[4783]: syslog-ng shutting down; version='3.4.7'
    2015:07:24-07:10:53 Firewall syslog-ng[4773]: syslog-ng starting up; version='3.4.7'


    Edit says: Logfile shown is from system.log
Share Feedback
×

Submitted a Tech Support Case lately from the Support Portal?