From 34a8a6f3576db2246c8d66fd1c664851a39598e2 Mon Sep 17 00:00:00 2001 From: phamt Date: Fri, 19 Nov 2010 20:31:00 +0000 Subject: [PATCH] Notified user if ganglia RPMs are not installed when "Monitor on" is clicked. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8217 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/web.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/web.pm b/xCAT-server/lib/xcat/plugins/web.pm index c496f2495..ab00036d2 100644 --- a/xCAT-server/lib/xcat/plugins/web.pm +++ b/xCAT-server/lib/xcat/plugins/web.pm @@ -52,6 +52,7 @@ sub process_request { 'gangliastart' => \&web_gangliastart, 'gangliastop' => \&web_gangliastop, 'gangliastatus' => \&web_gangliastatus, + 'gangliacheck' => \&web_gangliacheck, #'xdsh' => \&web_xdsh, #THIS list needs to be updated @@ -550,6 +551,33 @@ sub web_gangliastop() { #------------------------------------------------------- +=head3 web_gangliacheck + + Description : Check if ganglia RPMs are installed + Arguments : Node range + Returns : Nothing + +=cut + +#------------------------------------------------------- +sub web_gangliacheck() { + my ( $request, $callback, $sub_req ) = @_; + + # Get node range + my $nr = $request->{arg}->[1]; + if ( !$nr ) { + $nr = ''; + } + + # Check if ganglia RPMs are installed + my $info; + my $info = `xdsh $nr "rpm -q ganglia-gmond libganglia libconfuse"`; + $callback->( { info => $info } ); + return; +} + +#------------------------------------------------------- + =head3 web_chtab Description : Add, delete or update rows in the database tables