Value mapping

This time, we are interested in only one value, the one that decides how the value is displayed to us. Mark the checkbox next to the Show value entry to see the available options.

It looks like somebody has already defined entries here, but let's find out what it actually means before making a decision. Click on the Show value mappings link to the right on the same line:

Looking at the list, we can see various names, each of them having a list of mapped references. Look at the Name column, where the predefined entries have hints about what they are good for. You can see UPS-related mappings, generic status/state, SNMP, and Windows service-related mappings. The Value map column shows the exact mappings that are assigned to each entry. But what exactly are they? Looking at the entries, you can see things such as 0 => Down or 1 => Up. Data arriving for an item that has a value mapping assigned will expose the descriptive mappings. You are free to create any mapping you desire. To create a new category of mapped data, you need to use the button in the upper-right corner called Create value map. We won't do that now, because one of the available mappings covers our needs quite well. Look at the entriesremember the items we were curious about? They were monitoring a service and they used 1 to denote a service that is running and 0 to denote a service that is down. Looking at the list, we can see an entry, Service state, which defines 0 as Down and 1 as Upexactly what we need. Well, that means we don't have to create or modify any entries, so simply close this window.

You can access the value map configuration screen at any time by navigating to Administration | General and choosing show value mappings from the drop-down menu in the upper-right corner.

Back in the mass-update screen, recall the mapping entries we just saw and remember which entry fit our requirements the best. Choose Service state from the drop-down menu for the only entry whose checkbox we marked, Show value.

When you are done, click on the Update button. This operation should complete successfully. You can click on the Details control in the upper-left corner to verify that all three items we intended were updated.

Let's see how our change affected information display. Configured and assigned value mappings are used in most Zabbix frontend locations where it makes sense. For example, let's visit that old friend of ours, Monitoring | Latest data. Take a close look at the various server status entriesZabbix still shows numeric values for the reference, but each has conveniently listed an appropriate friendly name mapped value:

We have currently stopped the SMTP server to verify whether both 1 => Up and 0 => Down mappings workas we can see, they do. Value mapping will be useful for returned data that works like code values—service states, hardware states (such as batteries), and other similar monitored data. We saw some predefined examples in the value-mapping configuration screen before, and you are free to modify or create new mappings according to your needs.

Value mapping can be used for integers, decimal values (floats), and strings. One use case for strings could be the mapping of different backup levels that a backup software might return:

  • I => Incremental
  • D => Differential
  • F => Full

Navigate back to Monitoring | Overview and again, look at the various server status entries for ANOTHER HOST:

While value mapping doesn't seem too useful when you have to remember a single monitored characteristic with only two possible states, it becomes very useful when there are many different possible states and many possible mappings so that in most locations, you will have a quick hint about what each numeric value means and you are always free to invent your own mappings for custom-developed solutions.

..................Content has been hidden....................

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