Use Honghu to quickly build the company's IT equipment management solution

Description of Requirement

I believe that there should be some friends like us. There are many various systems in the company, such as asset management, CRM, issue management and so on. This article introduces how Honghu enables our asset system to display data according to our needs.

Our asset management system uses the open source Snipe-IT. Snipe-IT has won many users with its easy installation and deployment and rich content. Yanhuang is deployed using docker, as long as two containers are deployed. MySQL and Snipe-IT, so of course Snipe-IT's data is stored in MySQL.

Functionally, Snipe-IT can fully meet our current needs in terms of recording assets. But as time goes by, before the computer is about to reach the end-of-life deadline, I hope to receive reminders and make statistics in advance so that I can prepare for the next budget. Snipe-IT does not have such a function, but we can rely on Honghu's data analysis and display capabilities to realize our needs.

fulfillment of needs

We often have the feeling that I have data and ideas, but there is no tool that allows me to analyze and display my data flexibly. However, after understanding Honghu, such problems can be easily solved.

As for the expenditure on assets, most of them are currently consumed in the purchase of computers. If there are statistics about the purchase of computers next year, then the budget for next year will be much simpler. As for the purchase of computers, it is also divided into computer renewal and new purchases.

Computer replacement: The computer life is generally 4 years. After 4 years of arrival, colleagues can apply for a new computer, and the company will purchase it for them. (For the sake of this article, I temporarily set the computer renewal limit to 3 years, because our company has just been established for more than 2 years. If it is set to 4 years, there will be no data samples)

New computer purchases: Purchase new computers for new colleagues. Assuming that we plan to recruit 15 new colleagues next year, and allocate computers with different configurations according to different departments, we can estimate the purchase cost of new computers.

After more than a day of hard work, I basically realized my needs. The dashboard and other displays are as follows (because the data is sensitive, for display. The following is the desensitization of the data based on the real scene. The following numbers are not real business data):

picture

Figure 1 Asset Budget Dashboard

picture

Figure 2 Explains the total expenditure on computers

The '2023 estimated total expenditure on computer expenses (yuan)' is the sum of 'computer replacement expenses (yuan)' and 'new computer purchase expenses (yuan)'.

Where does the data for a new computer come from? We use JDBC to check the data in the MySQL table of snipe-it, and then send it to Honghu, which will be introduced in detail in the next chapter.

picture

Figure 3 Quarterly cost statistics for renewal next year

In addition, through statistics, we also know the cost of replacing our new computers in the next/several quarters (because the company was established in August 2020, when we count the data for 2023, we can only see the cost starting from the third quarter. The data). And from the detailed list, we also know which colleagues can apply for a new computer when and when, and estimate the cost based on the current market situation.

picture

Figure 4 Detailed table for renewal next year

Regarding statistics and calculations, in fact, only such a SQL is needed (SQL for counting the total cost of replacement). 

picture

With the dashboard, as long as you check it regularly, you can learn more about the cost of purchasing computers next year. However, the asset report is not updated frequently, so our attention will not be on it often, but as long as it is set regularly (I currently set it on the first day of each quarter), I can see a report that is always updated. So I set up the "set plan" of the dashboard. On the first day of each quarter, I received an email with the dashboard in PDF format. At the same time, it also reminded me that it was time to consider budget issues and simplify the workflow.

picture

Figure 5 Dashboard mail

picture

Figure 6 shows the dashboard in the PDF

Program Implementation Steps

Configuration of Snipe-IT

Because the deployment of Snipe-IT is very simple, I will keep it simple and paste the configuration file. The deployment of Snipe-IT requires only two containers, MySQL and Snipe-IT. for reference:

mysql.yaml (collapsible box)

picture

snipe-it.yaml (folded box)

picture

The deployed main interface is as follows:

picture

Figure 7 Snipe-it interface

Honghu accesses through JDBC

From the code in the configuration file above, we can see that Snipe-IT interacts with MySQL through port 3306, so we can use Honghu to access MySQL data through JDBC.

Honghu installation can refer to: https://yanhuang.yuque.com/books/share/b1b27937-e331-40fd-bce1-bd521af4e662/vvv9si

Let's execute a simple query to test JDBC to see if we can get the data in MySQL

picture

Figure 8 Test JDBC

The test was successful, but what we need is a continuously updatable data set so that we can make dashboards and monitor data.

For the import of data in MySQL to Honghu, I use the method of pre-stored query to import. If you want to import data from a relational database more quickly. You can contact our sales colleagues to obtain the commercial version of Yanhuang Data Platform. The commercial version has perfectly supported the import of MySQL data through JDBC.

First create a dataset, taking assets as an example:

picture

Figure 9 Create Dataset

I will create two pre-stored queries here, the first is to delete the data in the data set, and the second is to insert the data into the data set after fetching the data from JDBC. The specific process is 0:01, 6:01, and 12 every day :01, 18:01 Clear the data set, then query the database at 0:02, 6:02, 12:02, 18:02 and insert the results into the data set to achieve the purpose of regular update.

1. Create a stored query that clears data

picture

Figure 10 Pre-stored query for new clear data set

2. Create a pre-stored query for insert JDBC data, and insert the processed data into the assets dataset.

picture

Figure 11 Stored query for new and updated datasets

After executing the above stored query, our assets dataset has data. With the data we can make dashboards

Make a Dashboard

Create a Dashboard A Dashboard on Asset Budget

picture

Figure 12 New Dashboard

Then just add individual charts to the dashboard

picture

Figure 13 Icons in the new dashboard

See the final effect: Figure 1 Asset Budget Dashboard

email alert

In the edited dashboard, click "Set Plan" to start editing the set plan, select email as the action, and then enter your email. (Of course, it must be set up first, "Email Settings" in the system settings, see the reference for the specific location)

picture

Figure 14 Set plan in the dashboard

picture

Figure 15 Edit setting plan

In this way, you can receive the report email according to the date you set.

Huge value

As I said before, I have data and ideas, but I lack a simple tool that can help me realize data analysis and display, then Honghu can help you, as long as a few simple SQL statements, the data can be Show it according to your ideas. Then make the dashboard according to the actual needs. Show it to yourself and your boss. Coupled with the regular plan, it reminds us that it is time to make a budget, and calculate the budget later, which plays the role of data support.

Follow-up

This experience is also an exploration for me. I didn't know the data of MySQL before, so it can be easily connected to Honghu. In the future, we will also connect data from other systems to Honghu for centralized management and analysis. Putting the data of many systems together may cause some chemical changes.

Literature reference

Snipe-it : https://snipeitapp.com/

Honghu email settings:

 http://:18080/center/docs/preference/system/smtp/

Honghu JDBC documentation:

http://:18080/center/docs/integration/jdbc/

Guess you like

Origin blog.csdn.net/Yhpdata888/article/details/132089777