SQL database setup: Difference between revisions

From MyLVS
Jump to navigation Jump to search
Line 1: Line 1:
=Tst1=
*Login
root@mylvs01:/# mysql -u root -p
=Tst2=
*Login
root@mylvs01:/# mysql -u root -p


=mySQL=
=mySQL=
Line 13: Line 22:
  (3,1,'Reboot Server','/usr/lib/nagios/plugins/check_nrpe -H %HOST% -p 5666 -c reboot',2,'Reboot Server');
  (3,1,'Reboot Server','/usr/lib/nagios/plugins/check_nrpe -H %HOST% -p 5666 -c reboot',2,'Reboot Server');
<BR><BR>
<BR><BR>


=Webservice prepare=
=Webservice prepare=

Revision as of 16:26, 17 August 2015

Tst1

  • Login
root@mylvs01:/# mysql -u root -p


Tst2

  • Login
root@mylvs01:/# mysql -u root -p

mySQL

  • Login
root@mylvs01:/# mysql -u root -p
  • Change the database
mysql> use mylvs;
  • Insert the statements:
mysql>  INSERT INTO `tblCommands` (`cmdID`,`enabled`,`name`,`command`,`type`,`type-description`) VALUES 
(1,1,'Reset IIS','/usr/lib/nagios/plugins/check_nrpe -H %HOST% -p 5666 -c reset_iis',2,'Reset Service'),
(2,1,'Restart Apache','/usr/lib/nagios/plugins/check_nrpe -H %HOST% -p 5666 -c reset_apache',2,'Reset Service'),
(3,1,'Reboot Server','/usr/lib/nagios/plugins/check_nrpe -H %HOST% -p 5666 -c reboot',2,'Reboot Server');



Webservice prepare

One more change required to be done within the mySql tables, this is because every host must be preconfigured for myLvsmon.

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');