How to list Zabbix macro values for a host - macros

I've a Zabbix item which I can't get to work using a Zabbix macro.
The item key I start with looks like this:
web.page.regexp[10.0.0.100,/path,"(.*)",, \1]
And testing it with the following command also shows me nice results:
$ sudo zabbix_agentd -t 'web.page.regexp[10.0.0.100,/path,80,"(.*)",, \1]' --print
web.page.regexp[10.0.0.100,/path,80,"(.*)",, \1] [s|works]
But of course using the IP hardcoded isn't nice, that's why I want to use the predefined macros within the key, like this:
web.page.regexp[{HOST.IP1},/path,"(.*)",, \1]
But unfortunately this macro doesn't resolve to anything and the result looks like this:
web.page.regexp[10.0.0.100,/path,80,"(.*)",, \1] [s|]
Therefore I'd love to know if there's any way to list all the macro values for a specific host in Zabbix. Or is there a better way to use the {HOST.*} macros?
Using localhostis not an option for me - I want to test the public interface and I want to understand why the macros don't work as I expect it.
Cheers

Macro {HOST.IP1} should be expanded correctly for passive agent items (although it is suggested to just use {HOST.IP}). However, if your item is an active agent item, then {HOST.IP1} will expand to *UNKNOWN*, because an item is not attached to an interface in that case.
As for macro list for a host, it was implemented for user macros under ZBXNEXT-210 and is already available in pre-2.5.0 trunk (which is not ready for production yet).

Related

Extend list in omegaconf from command line

I have a configuration similar to this from a yaml file
training_variables:
- var1
- var2
I want to extend the list using an additional variable, and I want to do it from the command line. How to do it? It seems not possible but I think it can be very useful if you want to experiment a new setup without changing the configuration file every time. I was wondering something like this:
train.py training_variables=$training_variables+['var3']
This is not supported, and is not planned to be supported in the form you are requesting.
A practical solution is to split your list into two variables and concatenate them in the code.
base_list:
- a
- b
extra_list: []
train.py:
...
combined_list = cfg.base_list + cfg.extra_list
...
$ python train.py 'extra_list=[c,d,e]'
I am not 100% sure the above command line would work with an app using OmegaConf directly but it should work with Hydra 1.0 or newer.

CICS: can SYSIDNT be echoed in GMTEXT at startup?

I'm a newbie at this. In my CICS startup JCL I am setting a SYSIDNT of SYSIDNT=Hip1. Is it possible to echo this out to the terminal on startup just like I have found I can do with other things like &SYSUID and &APPLID?
If I have something like this:
SYSIDNT=Hip1
GMTEXT='CICS: &SYSUID, &APPLID, &RELEASE at'
Then I see something like this:
CICS: HIPPO01, IJCKBCDM, 730 at 10:47:11
But I cannot get Hip1 echoed out... and I'd like to know if that is possible to achieve. I see Hip1 echoed to screen once CICS is up and running and I'm using various transactions, so I'm positive it's set correctly - it's just that I can't see to tag it onto the GMTEXT.
I believe I got something I'm happy with by using an EXPORT and a SET statement for a new Symbol - I called SYSTEMID - and then assigned that to SYSIDNT and included it within the GMTEXT via &SYSTEMID.
//MYEXP EXPORT SYMLIST=(SYSTEMID)
//STEP1 SET SYSTEMID=HIP1

Can't Change Metric Alias in Grafana Using a Zabbix Plugin

I want to show multiple CPU Usage from different hosts in one graph but they all end up with the same name and I can't tell which line represents which host:
here's the snapshot.
I'm using Grafana 5.2.4 with a Zabbix plugin 3.9.1. My Zabbix version is 3.0.12.
I've tried overriding legends in Grafana but there's no such option. Also, Zabbix plugin doesn't allow connecting directly to DB, so I can't use the ALIAS BY option either. I've tried using macros in Zabbix to include host name in item name, but {HOST.NAME} just ends up as is in the item name (and not replaced by the actual values).
Any solutions will be hugely appreciated.
You should use the templating feature of the Zabbix Grafana plugin,see the attached screens and the following description for a working example.
I have a Routers Zabbix Hostgroup, so I define a Router Grafana variable to match the hosts (Routers.*), see the first screenshot.
Enable both multi-value and Select All
Then in the metrics configuration use a single metric configured this way:
Group: Routers
Host: $Router (mind the $, the variable will be expanded in real time accordingly to the selection)
Item: the common item name (i.e.: ICMP Response Time)
And you will get something similar to the second screenshot, with a host picker on top and multiple selections.
So There's a "Functions" button below each metric when we are configuring and editing our graph. There's an "Alias" option and when you hover over it you see more options. If you click on "setAlias", you can define an alias for each metric.
Since this solution requires setting each alias individually, I recommend the solution that was suggested by Simone Zabberoni above. but this one is also worth knowing since it might come in handy at times.

How can I create a Hierarchical block with GNURadio Companion?

I am trying to create a Hierarchical block using the GNURadio Companion GUI. Answers I've found in other posts say to select the blocks you want to incorporate, then go to More -> Create Hier. Then a new screen is supposed to appear. However, doing "Create Hier" with any combinations of blocks selected seems to do nothing.
Am I doing something wrong, or is there a problem with my GRC?
It's very simple. You just start with a new flow graph in GRC, and use Pad Sources as input, and Pad Sinks as output.
If you want to let the user configure something, use a Parameter GRC block.
You must set the Generate Options in the Options block to Hier Block, and set a sensible ID there, too – don't stick with top_block, but use something (without spaces or -; it needs to work as a python name) that won't conflict with something else.
Here's an example:
You can then Generate button (or press [F5]), and then, after you've done a rescan of your block library with the refresh button you can find (and use) your new block in the Block Category you specified.

Can I replace Host Names on Fiddler results?

Fiddler's host field is not always clear, especially with IP direct calls, or service calls I don't recognize.
I would like a way to replace certain names or name regex, with other more clearly defined names.
for instance, "193-149-72-221.drip.trouter.io" actually means Skype traffic, though the IP changes. so I would prefer to use: "*.drip.trouter.io".
Or, if there is a tag field or something like that that I can apply to hosts, and show the column in the list. I'm pretty flexible, but I'd really like to be able to classify or rename hosts to something I can recognize easier at a glance.
(I have looked around for this on google and checked similar questions on here with no luck)
Thanks.
Click Rules > Customize Rules.
public static BindUIColumn("MyFunkyName", 60)
function FillNameColumn(oS: Session): String {
if (oS.hostname.EndsWith("trouter.io") return "SkypeStuff";
if (oS.hostname.EndsWith("bunnies.com") return "CuteStuff";
return oS.hostname;
}
Save the file. You now have a column titled MyFunkyName which shows a string based on the hostname of the target.