Tips Fr Custmising Cnfiguratin Wizards ver 2010-06-22 Cntents Overview... 2 Requirements... 2 Applicatins... 2 WinSCP and Putty... 2 Adding A Service T An Existing Wizard... 3 Gal... 3 Backup Original CW + Create Cpy... 3 Windws Server CW... 3 Disk Read Write Services... 4 Add Read Service T CW Stage2... 4 Add Write Service T CW Stage2... 8 Uplad The Custm CW... 9 Test The Custm CW... 9 End Of Chapter... 9 Windws Perfrmance Cunters (WPC)... 10 Identifying WPC... 10 Extra Backslashes... 11 Understanding Hw WPC Are Used In Nagis XI... 11 Nagis XI Service Relatinship Map... 11 Plugins... 11 Cmmand Line / Cmmands... 12 Cmmands In Nagis XI... 12 End Of Chapter... 13 Trubleshting... 14 White Screen... 14 Abut Me... 15
Overview Nagis XI cmes with built in Cnfiguratin Wizards (CW) that allw yu t mnitr a hst with little effrt. Yu may have a handful f services that yu wuld like t add t a CW s yu d nt have t manually create them after the CW has been run. It is easy t mdify an existing CW t include yur custmisatins. Yu can als create yur wn CW nce yu have understd the hw a cnfiguratin wizard wrks. This dcument is a guide f tips t help yu achieve this. This dcument is a wrk in prgress s sme sectins may nt be cmplete r 100% crrect. Requirements My backgrund experience is Micrsft Windws s this guide is fcussed n perfrming all these actins frm a Windws 7 PC. I will direct yu t save files t C:\NagisXI\ as we prgress thrugh the guide. This dcument is based n a running virtual machine f Nagis XI dwnladed frm the Nagis Enterprise website. It is recmmended t be running the mst up t date release versin f Nagis XI. Applicatins There are three main prgrams I use thrughut this guide: Ntepad++ is used as the editr http://ntepad-plus-plus.rg/ WinSCP is used t transfer files t / frm yur Nagis XI server http://winscp.net/eng/dwnlad.php Putty is used t remtely access yur Nagis XI server t perfrm cnsle cmmands http://www.chiark.greenend.rg.uk/~sgtatham/putty/ WinSCP and Putty The first time yu cnnect t the Nagis XI server it will present a warning dialg bx abut the Nagis XI hst nt being in the lcal cache, click Yes and yu will nt be prmpted again. All the steps I use with WinSCP are dne using the Cmmander view. T enable this d the fllwing: Click Optins > Preferences Click Interface n the left menu Select the Cmmander radi buttn Click OK
Adding A Service T An Existing Wizard Name: Windws Server File name: windwsserver.inc.php Lcatin: /usr/lcal/nagisxi/html/includes/cnfigwizards/windwsserver Gal We ll mdify the existing Windws Server wizard. I want t add disk read and write services fr my Windws hsts. I d nt want t use warning r critical values r receive ntificatins; all I want is the statistical data that will generate pretty graphs. But first let s back it up Backup Original CW + Create Cpy Please create the directry C:\NagisXI\Backup. Open WinSCP Hstname: IP address f yur Nagis XI server Username: rt Passwrd: Yur rt Passwrd (nagisxi by default) Click the Lgin buttn Click in the right pane Click the Open directry/bkmark icn [Remte > Gt > Open directry/bkmark] In the remte directry type in /usr/lcal/nagisxi/html/includes/cnfigwizards/windwsserver Click OK In the left pane brwse t C:\NagisXI\Backup Drag the windwsserver.inc.php file frm the right pane t the left pane Click the Cpy buttn Wait fr the file t cpy In the left pane duble click n.. Parent directry Drag the windwsserver.inc.php file frm the right pane t the left pane Click the Cpy buttn Wait fr the file t cpy Clse WinSCP Windws Server CW Figure 1 is a screensht f the Windws Server CW. Figure 1
We will add ur disk read and write services t this sectin f the CW. Nte: in Figure 1 the fields are displayed and can be altered. We dn t require the user t change the fields fr disk read/write s we ll just nt shw them. Here is an example: Figure 2 Disk Read Write Services We are using Windws Perfrmance Cunters (WPC) t btain the data that will be turned int perfrmance graphs. There is a separate sectin in this guide that explains the use f WPC. \PhysicalDisk(0 C:)\Disk Read Bytes/sec \PhysicalDisk(0 C:)\Disk Write Bytes/sec Nte: fr every backslash (\) we need t use an escape character (\) s that the backslash is treated as text instead f being an escape character. This means we will end up with: \\PhysicalDisk(0 C:)\\Disk Read Bytes/sec \\PhysicalDisk(0 C:)\\Disk Write Bytes/sec Add Read Service T CW Stage2 Open the file C:\NagisXI\windwsserver.inc.php in Ntepad++ We are ging t cpy and paste an existing service Press Ctrl + F Type [uptime] and click Find Next Click Clse Highlight the entire uptime service (<tr> t </tr>)
Right click yur selectin and select Cpy Figure 3 Press Ctrl + F Type Perfrmance Cunter and click Find Next Yu will be taken t the Perfrmance Cunter sectin f Stage 2 Click Clse After the end f the perfrmance cunters sectin the table ends [see Figure 4] We are ging t add a line break and then create a new table fr ur disk read service [see Figure 5] Figure 4 Figure 5 Nw paste the cntents f yur clipbard in between the table and make sme changes Change: <input type="checkbx" class="checkbx" name="services[uptime]" checked> T: <input type="checkbx" class="checkbx" name="services[disk_0_c_read_bytes_sec]" checked> Change: <b>uptime</b><br> T: <b>disk 0 C: Read Bytes/Sec</b><br> Change: Mnitrs the uptime n the server.<br><br> T: Mnitrs Disk Read Bytes/Sec fr disk 0 C:<br> This shuld leave yu with this:
Figure 6 On Figure 6 yu can see that I highlighted services[disk_0_c_read_bytes_sec] This is the name that this service is called by the cnfiguratin wizard We will link this up in the end f the CW Press Crtl + S t save ur changes s far Press Ctrl + F Type case "uptime": and click Find Next Yu will be taken t the service creatin sectin fr the uptime service Click Clse Highlight the entire uptime service (case t break;) Figure 7 Right click yur selectin and select Cpy Figure 7
Paste this between the uptime service and the disk service Errr! Reference surce nt fund. Figure 8 Change: case "uptime" T: case "disk_0_c_read_bytes_sec": Change: "service_descriptin" => "Uptime", T: "service_descriptin" => "Disk 0 C: Read Bytes/Sec", Change: "check_cmmand" => "check_xi_service_nsclient!".$passwrd."!uptime", T: "check_cmmand" => "check_xi_service_nsclient!".$passwrd."!counter! -l "\\PhysicalDisk(0 C:)\\Disk Read Bytes/sec","Disk 0 C: Read Bytes/Sec is %.f"", Yu shuld nw have a screen that lks like Figure 9: Figure 9 Yu can see that I ve highlighted disk_0_c_read_bytes_sec This is hw we link Stage 2 f the CW with the case sectin that des the service creatin In Figure 6, line 380 ends with " checked> This defines that the check bx will be checked when the wizard runs If yu want the user t make this chice, remve the wrd checked "> When the checkbx disk_0_c_read_bytes_sec is checked, this tells the CW t prcess the case sectin later in the script. The case sectin is the bit that actually defines the services that are ging t be created
Press Crtl + S t save ur changes s far Add Write Service T CW Stage2 Yu can fllw the same steps in Add Read Service T CW Stage2, simply replace the wrk Read with Write thrughut the steps. Yu will end up with smething similar t Figure 10 and Figure 11. Figure 10
Figure 11 Uplad The Custm CW Open WinSCP Hstname: IP address f yur Nagis XI server Username: rt Passwrd: Yur rt Passwrd (nagisxi by default) Click the Lgin buttn Click in the right pane Click the Open directry/bkmark icn [Remte > Gt > Open directry/bkmark] In the remte directry type in /usr/lcal/nagisxi/html/includes/cnfigwizards/windwsserver Click OK In the left pane brwse t C:\NagisXI\ Drag the windwsserver.inc.php file frm the left pane t the right pane Click the Cpy buttn Wait fr the file t cpy Clse WinSCP Test The Custm CW Lgin t Nagis XI and run yur Custm CW Yu will nw have the disk read and write checks available fr selectin Finish the wizard and yu ll see yur new services yu ve created fr the hst yu ran the CW against End Of Chapter This cmpletes this sectin n adding a service t an existing cnfiguratin wizard.
Windws Perfrmance Cunters (WPC) We can use WPC as a way f btaining pint in time data frm a Windws hst. NSClient++ is the agent n the Windws hst that Nagis XI cmmunicates thrugh. Surce Infrmatin A perfrmance bject is any resurce, applicatin, r service that can be measured. Yu can select perfrmance bjects, cunters and instances t cllect data abut the perfrmance f system cmpnents r installed sftware. Identifying WPC Hw d yu knw what WPC are available n yur Windws hst? We use Perfrmance Mnitr t brwse the currently available cunters. I am lking fr a disk read bytes cunter. Lg nt yur Windws hst Start > Run > perfmn > OK Click the + icn [Add] We are lking fr disk cunters, in the list yu ll find PhysicalDisk Figure 12 Select Disk Read Bytes/sec Select 0 C: Click the Add >> buttn Click OK
Right click Disk Read Bytes/sec and select Prperties Figure 13 Figure 14 Yu can see here the cunter is expressed as: \PhysicalDisk(0 C:)\Disk Read Bytes/sec Click Cancel Extra Backslashes When we use WPC in Nagis XI we need t add extra characters. Fr every backslash (\) we need t use an escape character (\) s that the backslash is treated as plain text. This means we will end up with: \\PhysicalDisk(0 C:)\\Disk Read Bytes/sec I need a link here t sme dcumentatin that explains this crrectly. Understanding Hw WPC Are Used In Nagis XI There are several cmpnents that make yur service checks pssible. I will attempt t explain hw these cmpnents wrk tgether in Nagis XI. It is assumed that yu will already have used NSClient++. Nagis XI Service Relatinship Map Please refer t the Nagis XI Service Relatinship Map diagram that shws a graphical representatin f hw these cmpnents wrk tgether. This is a separate PDF file nt included with this guide. The relatinship map and the tpics belw shuld hpefully give yu a basic understanding f hw WPC are used in Nagis XI. Plugins A plugin is a script that is respnsible fr cmmunicating with devices t gather the infrmatin yu require A plugin culd make use f SNMP Gather infrmatin frm a switch r ruter using SNMP Requires n agent SNMP is widely used in enterprise hardware / sftware Sme plugins use an agent t perfrm the checks NSClient++ is an example f an agent
The agent is installed n a windws hst Nagis XI talks t the agent and issues the request The agent then respnds back with the results f the request check_nt is a plugin that is included with NSClient++ We use check_nt fr ur WPC checks Mre infrmatin abut check_nt can be fund here Cmmand Line / Cmmands Every check yu perfrm n yur Nagis XI server is issued frm the cmmand line The plugins used n the cmmand line vary fr each type f check Here is an example f the check_nt cmmand fr WPC: check_nt -H hstname -s passwrd -p 12489-v COUNTER -l "\\<perfrmance bject>\\cunter","<descriptin>" Nw lets translate that cmmand int \PhysicalDisk(0 C:)\Disk Read Bytes/sec check_nt -H hstname -s passwrd -p 12489-v COUNTER -l "\\PhysicalDisk(0 C:)\\Disk Read Bytes/sec","Disk Read Bytes/sec is %f" Yu can see that I added extra backslashes t the WPC as this is what is required by NSClient++ I als added the descriptin field that will return the result in the frmat I require, %f is the returning value frm the check_nt cmmand Cmmands In Nagis XI Here is an example f hw Nagis XI uses the check_nt plugin: Figure 15 is the check_xi_service_nsclient cmmand Figure 16 is frm an existing service using a WPC Figure 15
Figure 16 The service is using the check cmmand check_xi_service_nsclient The check cmmand check_xi_service_nsclient is using the check_nt plugin The $ARG1$ $ARG2$... fields in the service is hw we pass the infrmatin we require thrugh t the check_nt cmmand $ARG1$ is nt ppulated as I was nt using a passwrd t cnnect t this hst Yu can add yur wn cmmands t Nagis XI Uplad yur plugin via the Manage Plugins page Using Cre Cnfiguratin Manager g t the Cmmands sectin Add yur wn cmmand that runs yur upladed plugin End Of Chapter This cmpletes this sectin n WPC.
Trubleshting White Screen Quite ften when there is a mistake in yur custm CW cde, yu will get a blank screen when yu try t access the Cnfigure menu as seen in Figure 17. Figure 17 One way t diagnse is t watch the web server lg file in real time. Access the Cnsle f yur Nagis XI server r use Putty t cnnect t it remtely Username: rt Passwrd: Yur rt Passwrd (nagisxi by default) Type tail -f /var/lg/httpd/errr_lg and press Enter Initially yu will be shwn the mst recent errrs Press Enter a cuple f times t mve the text up the screen Nw g back t yur Nagis XI sessin and click Cnfigure n the tp blue menu Yur Putty sessin shuld have updated with sme reference t the errr, this shuld help yu t determine where in cde yur mistake lies Figure 18 Yu can see in Figure 18 that it is pinting ut an errr n line 510
Abut Me My name is Try and I am a Systems Administratr / Engineer based in Newcastle Australia. I can be cntacted thrugh the nagis frums as the user Bx293 r via my email address nagisxi@westnet.cm.au (cntact thrugh frums preferred).