Thursday, June 28, 2007

Remote management with Rails

The Rails demo for remote systems management with WS-Man is available at the openwsman web site.
Just follow the install and configure instructions. In short you need
  • openwsman
    An open source implementation of the ws-management standard.
  • rwsman
    Ruby bindings for openwsman client operations.
  • Ruby On Rails
    Web development that doesn't hurt
  • Railsapp
    Rails demo application for rwsman
Once everything is properly installed, start the Rails web server with ruby script/server. Now point your browser to http://localhost:3000 and you'll see the startup page. Click on the text, then click on Discover and the Discovery page will appear.

Look closely at the Actions line for each host and you'll notice the YaST action for the openSUSE client. This client has my openwsman-yast plugin installed.
The demo application allows to start and stop the desktop (the xdm service to be precise) and to switch the desktop environment between KDE and GNOME. YaST operations

Doc has videotaped a demo, you can find it in the idea.opensuse.org blog.

2 comments:

blanch said...

At Hospital Clinic de Barcelona, we are evaluating the feasibility to develop a home made Energy Monitoring System, for PCs and printers, in order to promote hibernation during out of off work times and save energy

I have been trying to bring up the demo aplication you talked about on this post

I have managed to adapt the application to the new API interfaces of OpenWSman, but it seems that there is a small bug in the implementation of the access to the YaST plugin

Both from the ruby demo, and from the wsman command interface, we get an error message when invoking the execute procedure.

It seems that the module yast_stub_custom.c looks for an unexistent ycp node in the inblound XML message

next there is the call that raises the error

hnode_t *ycpnode = hash_lookup( method_args, "ycp" );
debug ("YaST: 'ycp' node @ %p", ycpnode );
if (!ycpnode) {
status.fault_code = WSMAN_SCHEMA_VALIDATION_ERROR;
status.fault_detail_code = WSMAN_DETAIL_INVALID_VALUE;
debug( "YaST: no 'ycp' property found for 'eval'" );
goto cleanup;
}

kkaempf said...

Indeed, openwsman-yast is broken for recent versions of openwsman. Sorry for that !

I have updated openwsman-yast at the OpenSUSE build service. Please grab version 1.5.10 from there