cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
347
Views
8
Helpful
8
Replies

Help with Reboot Macro

Gillian-davis
Level 1
Level 1

Hello!

There has been a request for a reboot macro/button to be installed on the touch panels in our conference rooms. These reboot buttons will be used by employees as a last resort. I know that there is a way to reboot from the service page, but I don't want that to be public information or allow unrestricted access to that menu. Does anyone have any experience with this?? I would love some assistance!

2 Accepted Solutions

Accepted Solutions

Maybe something simple as this could work for you?

 

import xapi from 'xapi';
const xapi = require('xapi');

function onGuiRestart(event) {
  if (event.PanelId == 'device_restart') {
	boot();
  }
}

function boot() {
    xapi.Command.SystemUnit.Boot();
    console.log('Executing triggered reboot... (Reboot macro)');
}

xapi.event.on('UserInterface Extensions Panel Clicked', onGuiRestart);

 

 

Do note I have not tested it on any device, so use it with that in mind. Also you'd might want to evolve the macro to ask for a confirmation before the reboot is done, just so that it doesn't restart immediately when someone presses the UI button.



Response Signature


View solution in original post

Glad to hear that. Please take the time to mark this as solved by selecting the appropriate answer as the solution.



Response Signature


View solution in original post

8 Replies 8

I have a macro that restarts our VC systems daily on a schedule. Likely it can be adopted to work with a trigger button. It’s after hours where I live. I’ll get it tomorrow and share it with you.



Response Signature


Leo Laohoo
Hall of Fame
Hall of Fame

@Roger Kallberg 

Would you be able to share the reasoning or the logic why anyone would want to reboot their VC daily?  

Thanks for sharing.

There are quite frequent issues with the endpoints after a software update and instead of trying to figure out when the software update has occurred we took the somewhat easy way out and restarts the devices daily at 3.00 am local time and only if the device isn’t in an active call. If it is it will be delayed for an hour and then the check is done again in until the device is restarted.



Response Signature


Thanks for the feedback, @Roger Kallberg

Daily reboot is going to be the new direction for wireless access points too.

Maybe something simple as this could work for you?

 

import xapi from 'xapi';
const xapi = require('xapi');

function onGuiRestart(event) {
  if (event.PanelId == 'device_restart') {
	boot();
  }
}

function boot() {
    xapi.Command.SystemUnit.Boot();
    console.log('Executing triggered reboot... (Reboot macro)');
}

xapi.event.on('UserInterface Extensions Panel Clicked', onGuiRestart);

 

 

Do note I have not tested it on any device, so use it with that in mind. Also you'd might want to evolve the macro to ask for a confirmation before the reboot is done, just so that it doesn't restart immediately when someone presses the UI button.



Response Signature


Gillian-davis
Level 1
Level 1

This was exactly what I was looking for. Thank you for your assistance!

Glad to hear that. Please take the time to mark this as solved by selecting the appropriate answer as the solution.



Response Signature