📜 ⬆️ ⬇️

View Storwize Array Configuration with R - Shiny Dashboard

IBM's Storwize disk arrays are well known in the market, but with a convenient tool for viewing their configuration (especially without access to the array itself), with the exception of IBM’s Total Productivity Center software, there is nothing (perl svcmon scripts are no longer supported). And employees and, or partners, who analyze the configurations of these arrays, often have such a need. Therefore, I propose my solution for viewing xml files of data configuration of arrays.

In this article I will describe how you can read xml information, present it in the form of tables, summary information on dashboards, and all this in the form of a web application. As the name of the article suggests, this is implemented on R, with a package (framework) for web applications to R - Shiny dashboard .

image

Benefits R


To view the xml files for configuring the data of arrays, there was previously a set of perl scripts - svcmon, which were very inconvenient to use (it was necessary to have Perl and PostrgreSQL installed), and the result in a single html file was not very impressive. Therefore, having become acquainted with the possibility of parsing XML files using R, and even learning about the Shiny Dashboard package, I decided to write my parser with convenient visualization and sharing as a web application.
')
As in my previous article, the advantages of R are obvious, using only one software product, you can parse files and conveniently convert data, display various charts, perform statistical analysis, create a web application that can be placed in open access, and now, with using the Shiny Dashboard framework, thanks to which the elements of the output are placed on the dashboards, these applications become even more beautiful and visual.

Sequence of viewing the xml configuration files


I. Loading xml data

Information is loaded by the xmlParse () function from the package. Despite the seeming simplicity of these xml files (object - value), I had to tinker a bit with correctly pulling out all the values ​​in accordance with all their headers. This is done using the getNodeSet function, into which you must pass the xpath , which in turn is formed by concatenating the entire path of the desired node. The following post and its author helped me to understand the functions of this package.

Ii. Data ordering

After the data has been drawn, they are converted into a tabular view, then you can convert them, leading to a convenient form, for example, forming a ready-made profile of the array configuration. I have not done this yet, all the tables are in the canonical, original form. Various modifications (merging, splitting, transition from long to wide and vice versa) with tabular data allows performing functions from dplyr , tidyr packages .

Iii. Dynamic control ( Shiny Dashboard )

Unlike my previous post, where Shiny served as an interface, this tool will be implemented on Shiny Dashboard . Shiny Dashboard is an extension of the Shiny package (framework) for creating dashboards in your web application. I learned about it recently, and I wanted to practice, but the object for research is already at the ready.
In Shiny Dashboard - 3 controls are used:
- title (on which you can put 3 menu buttons - messages, notifications and tasks);
- sidebar (any input elements and menu items are placed, including submenus);
- the main panel.

The main idea of ​​the Shiny Dashboard is that on the main panel first deshboards are placed (line by line or column-by-line), and any elements of the conclusions can already be placed on them. Dashboards have flexible settings for visualization, they can be of any size, they can be assigned icons, colors, titles, deshboards can be collapsed, moved, they can even have bookmarks, each with its own output elements.

Briefly about the implementation and results


1. First, the user-selected xml array configuration file Storwize opens;
2. After parsing this file (less than 1 second), the initial tables are formed, on the main page the summary information on the array is given, including graphically;
3. When a menu section is selected, corresponding tables are formed on the basis of it;

Below are some screenshots of my Shiny Dashboard application for viewing configuration files, with an individual selection of the required table.
Screenshot of the title bar


On the left side panel, in which we load the source file, and select the table to view, and on the main panel (with the Summary menu item selected), displayed the main characteristics of the array.

Screenshot of one of the menu items


And with this choice of the ( Drive ) menu, a table of physical disks is displayed, for it I used the DataTable element (since there are many disks), which allows sorting, filtering, searching for data by parameters.

Almost everything is implemented on the basic elements of Shiny, although I had to resort to CSS twice. Dashboards, in essence, are designed to accommodate elements that fit within the screen, but in my case some tables are much larger, so I had to override the tag of the scrollbars of the dashboards, and considering the significant number of menu items, I also had to use CSS to reduce the size of the menu items. But these changes are simply described in the css file, which must be placed in the www directory, and indicate the link in the R code.

Conclusion


Continuing to explore and popularize R in passing, I additionally studied the Shiny Dashboard . R is a very convenient tool for many applied tasks (not even relating to statistical analysis), similar to this one, both in terms of ease of use and speed in obtaining results. In this case, once having written this application, you can save hundreds of hours later. The additional use of Shiny (as a personal server or a cloud server) will allow you to demonstrate the results in a more convenient and beautiful form, and significantly increase productivity.

Source: https://habr.com/ru/post/256689/


All Articles