[Hinemos x IFTTT] Output monitoring results to Google spreadsheet

Hello!
Recently, I was experimenting with a tool called IFTTT and found out that is amazing!
In this article, I will explain how IFTTT can work with Hinemos.

But before, let me explain a little about IFTTT first.

IFTTT is a service that enables users to easily integrate different Web services by creating a setting called “applet”.

If it’s just simple Web service integration, you can do it by doing programming now. The appeal of IFTTT is that you can easily integrate Web services without the knowledge of programming.

IFTTT enables the following operation.

  • Obtain monitoring results
  • Send monitoring results
  • Activate a trigger in IFTTT
  • Output monitoring results to a specified Google spreadsheet.

In this article, we will receive output date, priority and message data from Hinemos, and then output it on a Google spreadsheet.
Now, let’s configure the setting.

1.Create an applet with IFTTT

First of all, create an applet with IFTTT.
Sign in from https://ifttt.com/. (If you do not have an account, create it.)
Select “New Applet” from the pull-down menu of the account after signing in.

Create “This (trigger)” first.
Click “This”, and the search window shown below will be displayed. Enter “Webhooks” in it, and then select “Webhooks” displayed as a search result.

Select “Receive a web request”.

Fill in “Event Name”, and then click “Create trigger”.

This will enable execution of an appropriate action when a Web request containing the information specified in “Event Name” is received.
Make a note of the event name since you will need it later.

Next, create “That (action)”.
Click “That”, and the search window shown below will be displayed. Enter “Google Sheets” in it, and then select “Google Sheets” displayed as a search result.
*If you use Google Sheets for the first time, click “Connect” on the pop-up window to configure the authentication setting.

Select “Add row to spreadsheet”.

Fill in “Spreadsheet name”, “Formatted row” and “Drive folder path”, and then click “Create action”.

  • Spreadsheet name
  • Formatted row
  • Drive folder path
  • :Name of the spreadsheet
  • :Format of the rows to be added (separate cells with “III”)
  • :Path of the folder where the spreadsheet is placed
 

Edit the title and click “Finish”.

The configuration of IFTTT is complete if the applet is “On” on the displayed screen.

Next, let’s create a Google spreadsheet where monitoring results will be output.
Create a spreadsheet with the same name as the spreadsheet name under the drive folder path specified in the “Add row to spreadsheet” setting.
This time, we created a spreadsheet named “Hinemos_IFTTT” under the “IFTTT” folder, and formatted it using the Conditional Formatting feature so that the cells in the Priority column will turn into corresponding colors respectively when you enter “Information”, “Warning”, “Critical” or “Unknown” in them.

2.Creating settings on Hinemos

Next, make preparations on the Hinemos side.
This time, we will execute a script that sends monitoring results via a Web request, using the Command Notification feature.

Click “Webhooks” in the top left-hand corner to move to the screen shown below from the screen of the applet created earlier (My Applets > the applet created earlier).

Click “Documentation” to display the key value.

You can test the created applet using “Test it” in the lower left-hand corner. If you are concerned, try entering the necessary information to see if it will be properly output on a spreadsheet.

Next, place the following script (hinemos_ifttt.sh) in the manager server.
Enter the event name of the applet created in 1.
*The descriptions below are provided assuming “hinemos_ifttt.sh” is located under “/tmp”.

Log onto Hinemos manager where the script is located from Hinemos client.
Create a Command Notification setting in the Monitor Setting [Notification] view of the Monitor Setting perspective.

The command that will be executed is shown below.

3.Confirm operations

Since the configuration of monitoring results transfer from Hinemos to a spreadsheet was complete in the previous section, now let’s check operations.
This time, we will monitor CPU utilization and output it on a Google spreadsheet.
Configure the Resource Monitor setting as follows.
*Configure the Event Notification setting as well to confirm output information.

If you check the Monitor History [Event] view, you can see the monitoring results of CPU utilization are displayed.

If you check the Google spreadsheet, you can see output date, priority and message data has been output on a spreadsheet successfully.
The output information is the same as that displayed in the Monitor History [Event] view.

Other than the Google Spreadsheet, IFTTT can be used to combine Hinemos with Slack, LINE, etc., making it much easier to integrate Hinemos with a Web service.

That’s it for today!
See you next time.