Cloning items

Let's try to monitor another service now, for example, the one running on port 22, SSH:

  1. To keep things simple for us, we won't create an item from scratch this time; instead, go back to Configuration | Hosts.
  2. Click on Items next to Another host.
  3. Click on Web server status in the Name column. This will open the item editing screen, showing all of the values we entered before.

This time, there are different buttons available at the bottom. Among other changes, instead of the Add button, there's an Update one.

Notice how one of the previously seen buttons is different. What was labeled Add previously is Update now. This change identifies the operation that we are going to perform: either adding a new entity or updating an existing one. We might open a configuration form intending to clone the entity, scan the fields, change some values, but forget to click on the Clone button. In the end, the existing item will be changed. The difference in the labels of the Add and Update buttons might help spot such mistakes before they are made.

There's also Delete, which, obviously, deletes the currently open item. We don't want to do that now. Instead, click on Clone.

Notice how the opened form proposes to create a new item, but this time, all values are set to those that the original item we cloned had. The Update button is changed to Add as well. Click on the Add button—it should fail. Remember, we talked about the key being unique per host; that's what the error message says as well:

The item editing form is still open, so we can correct our mistake. Make the following modifications:

  • Name: Change it to SSH server status
  • Key: Change http,,80 to ssh so that it looks like this: net.tcp.service[ssh]

That's all we have to do for now, so click on the Add button at the bottom again. This time, the item should be added successfully. Now navigate to Monitoring | Latest data, where Another host should have two items listed—SSH server status and Web server status. Their status will depend on which services are running on the remote host. As it's remote, SSH most likely is running (and hence has a value of 1), but whether or not the web server is running will be specific to your situation. Be aware that it can take a few minutes before you get the first value in the latest data for our new item:

The monitoring of a port is often done to make sure the service on it is available, but that is not a strict requirement. If some system is not supposed to have SSH available through the internet, we could use such a check to verify that it has not been accidentally exposed either by the inadvertent starting of the SSH daemon or an unfortunate change in the firewall.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset