Webservice prepare: Difference between revisions

From MyLVS
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:
  root@mylvs01:/var/www/mylvs/ws/cgi-bin# chmod 777 lvs.cgi
  root@mylvs01:/var/www/mylvs/ws/cgi-bin# chmod 777 lvs.cgi
  root@mylvs01:/var/www/mylvs/ws/modules# chmod 777 lvs.pm
  root@mylvs01:/var/www/mylvs/ws/modules# chmod 777 lvs.pm
*'''Note: The webservice requires mylvsmon to run'''





Revision as of 18:15, 11 August 2015

Webservice prepare


INSERT INTO `tblMaintenance` (`mID`,`enabled`,`ip`,`hostname`,`groupID`,`requestUP`,`requestDOWN`,`WeightDownTime`,`WeightDownPending`,`TurnOffTime`,
`TurnOffPending`,`response`,`message`,`updatepending`,`requestDate`,`responseDate`,`receivedfrom`,`CurWeightDownTime`,`CurTurnOffTime`,`DSLMaintenance`,
`DSLRenewRequest`,`DSLDate`,`DSLEpoche`,`DSLIP`) VALUES 
(1,1,'192.168.2.221','hh',1,0,0,30,0,30,0,200,'Host has been turned on',0,'0','20150727143609','0','0','0',0,0,'0',0,'0'),
(2,1,'192.168.2.222','hh',1,0,0,30,0,30,0,200,'Host has been turned on',0,'0','20150727143230','0','0','0',0,0,'0',0,'0');


Install on ALL machines:

  • apt-get install libsoap-lite-perl -s
  • apt-get install libsoap-lite-perl


root@mylvs01:/var/www/mylvs/ws/cgi-bin# chmod 777 lvs.cgi
root@mylvs01:/var/www/mylvs/ws/modules# chmod 777 lvs.pm


  • Note: The webservice requires mylvsmon to run


From the client:

#!/usr/bin/perl -w
use SOAP::Lite + qw/ trace /;
my $soap = SOAP::Lite
  -> uri('urn:lvs')
  -> proxy('http://ws.mylvs.foo/cgi-bin/lvs.cgi');
#my $result = $soap->REQUESTWEIGHTSTATUS ();
#my $result = $soap->WHATISMYIP ();
#my $result = $soap->REQUESTWEIGHTDOWN ();
my $result = $soap->REQUESTWEIGHTUP ();
unless ($result->fault) {
 print $result->result();
} else {
  print join ', ',
    $result->faultcode,
    $result->faultstring;
}