Creating a value map

Value maps couldn't be controlled via the API before Zabbix 3.0. They were needed for many templates, though, and people resorted to SQL scripts or even manually created value maps with hundreds of entries. That's dedication. Since Zabbix 3.0, things are much easier, and now, value maps are supported both in the API and XML import/export. Let's create a small value map:

$ json='{"jsonrpc":"2.0","method":"valuemap.create","params":{"name":"Mapping things","mappings":[{"value":"this","newvalue":"that"},{"value":"foo","newvalue":"bar"}]},"auth":"df83119ab78bbeb2065049412309f9b4","id":1}'
  

Run the curl command:

{"jsonrpc":"2.0","result":{"valuemapids":["16"]},"id":1} 

If you check the new value map in the frontend, it's a bit easier to read than in that JSON:

We covered value maps in Chapter 3, Monitoring with Zabbix Agents and Basic Protocols.
..................Content has been hidden....................

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