Junos OS

Expand all | Collapse all

Restart the Management Daemon

Jump to Best Answer
  • 1.  Restart the Management Daemon

    Posted 02-03-2020 15:41

    Hi,

    In past I have had a few switches stop responding to management traffic. This means I can't ping the switch or SSH to it.

    Users don't report any issues, so it sounds like it could be a problem with the MGD process.

     

    To resolve this, I can simply reboot the switch, however this impacts the users that are still functional.

    Is there a way I can restart just the management daemon?

     

    I found this article, which says that I can use 'restart management'. However, this command doesn't exist for me (I've checked on an EX2200 and EX2300).

    https://kb.juniper.net/InfoCenter/index?page=content&id=KB25382

     

    Is there any other option I can try?

     

     

    Thanks


    #mgd
    #process


  • 2.  RE: Restart the Management Daemon
    Best Answer

    Posted 02-03-2020 17:35

    Hi,

    Have you tried running restart management. The management  is a hidden command on the EX.

     

    Thanks

    John



  • 3.  RE: Restart the Management Daemon

    Posted 02-03-2020 20:04

    That's exactly it, thanks!



  • 4.  RE: Restart the Management Daemon

     
    Posted 02-03-2020 17:42

    Hi Luke Robertson!

     

      In some platforms as you correctly stated, the command may not show as available:

     

    root@s10-33> restart m
    Possible completions:
    > mc-ae-config-check-service MC-LAG Configuration Consistency Check daemon
    member Restart software process on specific virtual chassis member (0..9)
    > mgd-api Management Daemon GRPC server
    > mib-process Management Information Base II process
    > mosquitto Mosquitto Broker for notification
    > multicast-snooping Multicast Snooping process

     

    However, in some platforms the command is hidden to prevent mistakenly restarting it. But If you manually type the full command it may work:

     

    root@s10-33> restart management
    Management process started, pid 30895

    WARNING: cli has been replaced by an updated version:
    CLI release 18.1R3.3 built by builder on 2018-08-30 05:29:08 UTC
    Restart cli using the new version ? [yes,no] (yes) yes

     

     If this still does not work, you can kill it from shell using root access. (using this wayyou need to kill each mgd individually):

     

    start shell user root
    root@s10-33:RE:0% ps -auwx| grep mgd
    root 4550 0.0 0.4 280500 7284 - I Sat07 0:00.08 /usr/sbin/mgd-api -N
    root 30895 0.0 1.6 300196 32136 - S 17:31 0:01.24 /usr/sbin/mgd -N
    root 30927 0.0 1.6 300196 32340 - Ss 17:31 0:00.05 mgd: (mgd) (root)/dev/pts/0 (mgd)
    root 31039 0.0 0.1 8512 2192 0 S+ 17:32 0:00.01 grep mgd
    root@s10-33:RE:0% kill 4550
    root@s10-33:RE:0% kill 30895
    root@s10-33:RE:0% kill 30927
    root@s10-33:RE:0% exit

     

     Please note that either method will logout out of the switch and cancel any pending configuration not committed.

     

    Best regards!

    Esteban, 

     If this clears your concerns, please mark as solve!



  • 5.  RE: Restart the Management Daemon

    Posted 02-03-2020 20:05

    Yes, that did it.

    I'll save the shell commands for next time too. Do the processes automatically start again after they're killed?



  • 6.  RE: Restart the Management Daemon

     
    Posted 02-03-2020 20:44

    Yes, processes will restart as soon as you kill them.

     

    Best Regards!

    Esteban



  • 7.  RE: Restart the Management Daemon

    Posted 02-03-2020 20:50

    They should come back up automaticaly with a different PID after restarting it. 

     

    You just need to make sure to not restart a process 3 times in a row, since in that scenario, the process might not come back automatically.



  • 8.  RE: Restart the Management Daemon

    Posted 02-04-2020 13:28

    @dnavarro24 wrote:

    You just need to make sure to not restart a process 3 times in a row, since in that scenario, the process might not come back automatically.



    That's good to know, thanks!