My Linux virtual machine reboots automatically without my interruptions. How do I know who rebooted the vm?

Kattekola Mahesh 5 Reputation points
2024-07-02T04:52:34.73+00:00

Hi Team,

We created Linux Virtual machine and hosted our application inside the server.

everything working fine but last week my application went down so after my investigation, jar was killed because of Reboot happened inside the server.

How do I know who rebooted the vm?

please find the attached screenshot.Linux-server.png

Thanks & Regards,

Mahesh.Kattekola.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,986 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deepanshukatara-6769 10,210 Reputation points
    2024-07-02T05:07:05.48+00:00

    Hi Mahesh , Welcome to MS Q&A

    • You can use the last command to see the reboot history
             last reboot
             
      
    • The last command can also show you who was logged in at the time of the reboot:
        last
        
      
    • If you have auditing enabled, you can check the audit logs for any user actions that might have triggered the reboot.
         ausearch -m SYSTEM_BOOT
         
    
    
    

    Kindly check and let us know if any further questions

    Please accept answers if it helps

    Thanks

    Deepanshu

    0 comments No comments

  2. Kattekola Mahesh 5 Reputation points
    2024-07-02T05:20:49.0633333+00:00

    Hi Deepanshukatara,

    I am able to see inside the server below information (reboot happened on 28thJune2024)

    reboot system boot 5.15.0-1067-azur Fri Jun 28 19:53 still running

    reboot system boot 5.15.0-1064-azur Tue Jun 18 04:20 - 19:53 (10+15:33)

    reboot system boot 5.15.0-1064-azur Tue Jun 11 10:43 - 04:20 (6+17:36)

    reboot system boot 5.15.0-1064-azur Mon Jun 10 07:02 - 12:25 (05:22)

    We think the reboot is due to guest patching inside the server.

    Thanks & Regards,

    Mahesh.Kattekola.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.