How do your configs for the command, the service template and the service apply rule look now?
Consigned to /dev/null along with the rest of this system. It’s worth what I paid for it.
Considering that you have used nagios before, by your own statement, which generally has the same structure of running checks, meaning
- configure a check command that has your needed arguments
- configure a service template that used said check command
- ping the service to a host using the service template (icinga2 even offer the apply rules that have way more flexibility)
I am surprised about the troubles you have.
Seems to me that you don’t (or don’t want to) understand what you are doing or where I was trying to help.
As you haven’t replied to my posts with valid information about your config, so that I could help you further, I assume you are(were) still using your wrong config for either the service template or the check command, resulting in non working checks.
All the best with whatever system works for you.
But please don’t hate against Icinga 2 because you weren’t able to get it up and running as fast as you would have liked.
I think you misunderstand. I have used Nagios and I have used and created the config files. I was drawn to Icinga because of Director.
Yes I could have done this all in config files and I’m sure as a Nagios clone it would have worked fine, but why use a clone when I can use the original. Editing multiple interlinked config files was such a faff and I’ve got better and more profitable things to do with my time plus this is 2020 not 1980 so a web interface should be the way to go. I tried many of the early web interfaces for Nagios back in the early days, none really worked 100% but Director looked like the answer, sleek, modern and usable from anywhere on any device.
It hasn’t delivered and I have tried and I have given screenshots & log entries. I guess my beef is with Director rather than Icinga but I don’t have the time to invest in hand crafting Icinga configs. My methodolgy is to try and get something working without referencing the manual if possible, this shows me how intuitive the design is and how easy the product is to use, this is how web interfaces should be, hand editing config files would of course necessitate a good knowledge of the workings of the product. If we had to refer to the technical manual for a microwave every time we cooked a different meal, we’d soon be looking for a different microwave. For now the Icinga platform has been flattened on the VM I’m using as I move on to try something else, who knows, I may come back to it if the alternatives fail harder than this trial did Thanks for trying. Watch this space…
Hi.
If anyone else struggles with this, here - analogous to my previous post - a complete example for the “mem” check.
- create custom-variables, the field names are the same as in the CheckCommand definition:
- Add variables from step 1 to the already existing “mem” CheckCommand -> Fields
- Create a “Service Template” using the “mem” CheckCommand, which we added the variables to, in step 2
(only the important parts)
The variables we added to the CheckCommand are now visible here and can be changed / set (“Custom properties”)
-
Finally, we can add a “Service Apply Rule” to dynamically determine where this service should be added.
E.g. (don’t worry about the name, it is just an example)
(again, only the important parts)
So this will be assigned to hosts, where the variable host.vars.os is set to “Linux”
Greetings.
Just for clarification: At point 3: isn’t it a “Service Template” that you need to create?
Yes, thanks - absolutely right.
Sorry, I’m very new to the director - i just followed the steps @log1c provided.
I’ll edit it
Greetings
Thanks, that’s pretty much where I got to but on the agent I got:
Running command ‘/usr/lib64/nagios/plugins/check_mem.pl’ ‘-c’ ‘5’ ‘-f’ ‘true’ ‘-u’ ‘false’ ‘-w’ ‘10’
Maybe I missed a step but by that time I’d followed so many different paths it was beginning to become like a maze of multiple places to put the same information in different ways. It’s probably me but like I said, if it’s not intuitive it’s failing at the first hurdle for me. Maybe a simple quick start guide will appear to make this easier for those of us who want to be Director based rather than hand configured multi-config file based, that is its purpose after all is it not?
Hi again.
Maybe this occurs, because mem_free is not part of your CheckCommand.
As you also changed the other names, this also cannot work.
The variables in the Service-definition have to correspond to those in the CheckCommand.
Anyways, there is no need to create an own CheckCommand for this purpose. You can use “mem” for the Service-Template instead of your “my-mem-check” and it should work.
Greetings.
Except it didn’t and that wasn’t the final version I ended up with and that still produced an error.
The Director web interface seems to have let me enter garbage and verified that garbage as OK, I can see why Wikipedia turned off public access when they switched from Nagios to Icinga.
It’s all in the bit bucket now so it’s pointless continuing this thread.
As you didn’t share anything after you were fed up with using the Director, we had to assume you hadn’t changed anything.
Exactly.
That’s why I will close this now.
Anyone having trouble with creating commands can open a new, fresh and clean thread describing their problem. The mem command and how to add the true/false fields to it was decribed by @homerjay and me.