Icinga Web - Adding host with Agent

This forum was archived to /woltlab and is now in read-only mode.
  • negative, this did not work for me. and I was unaware that it uses the icinga service to handle snmp commands. I was thinking it used the windows built in. "good to know"


    any other ideas?

  • Hey WudChuK,


    I have been messing with this myself for the past couple of days because theoretically, the way that you're deploying the service/host would be correct.


    I think I have found the solution (finally)!


    Keep in mind this may be hard to grasp at first, so read and reread everything that follows very carefully:


    Background:
    Going back to this thread that I linked a while back, you will see the main root of the problem that we were both facing. Basically, the problem was that the "command_endpoint" variable was being set in Director to be "host_name" (as shown in your video), but my working solution was manually configuring it in the backend to set "command_endpoint" to the Endpoint name generated by the agent installation. This defeats the purpose because then I couldn't use Director to configure it. Also, I couldn't simply change "host_name" to that Endpoint name because then I would generate an error for two instances of the same host. Refer back to my thread for more details on that.


    Solution:
    Knowing that the "command_endpoint" variable had to be set to the Endpoint name generated by the agent installation, I knew I had to create a custom variable for the Director service to run with. So, the first step is to create a Data Field. Basically, a Data Field in Director is a custom variable that you can assign to service definitions.


    For example, I use a Data Field called "tcp_port" for a TCP check that I recently deployed. It checks the port used for RDP connections, so I can see whether or not the system that I'm checking has allowed RDP connections.


    To do this, click on Icinga Director. You'll be presented with the following page. Click on the "Define data fields" box.

    Once you're there, click "+ Add" to add a new Data Field. In that interface, follow this picture:



    Keep in mind that you can put whatever you want for the caption and description, but keep field name and data type like I have it.


    From there, go back to the host that you want to deploy and import a template that does NOT use an agent. Make sure to click "Store" on every change that you do.


    After that, go to your service (SNMP in your case) and make sure that you also make sure that this does NOT run on an agent.


    Now it's time to add in the Data Field that we created earlier (command_endpoint). Click on your service and go to the tab that says "Fields". This should be in the top right corner, as it is in this picture:



    Notice that I have already performed this step, so my command endpoint variable is already set. Keep in mind that you do have to set the OID that you'd like to use as well (just define another Data Field like we did for command_endpoint).


    In the Fields interface, select the "command_endpoint" data field and change the Mandatory flag to "Mandatory". This makes it so that the data field must be filled in before you can deploy the service. Click "Add" after you've selected these options.


    Go back to your service (at the "Service" tab) and now you'll enter in the name of the endpoint that the agent generated. This can be found in your backend. The name should be located as a .conf file in "/etc/icinga2/repository.d/endpoints/" by default. For me, it's called "datacenter-development". Click "Store" after you're done, and then deploy the configuration via Activity Log.


    Now all that's left to do is wait for the check. The plugin may not execute depending on if you have configured SNMP correctly or not on the system that you're trying to check.


    If you have any questions or need more explanation at any parts, let me know. Also let me know where this gets you and we'll take it from there!


    P.S.


    Visit this link and search for "snmp" to find more fields that you can fill out for the check.

  • I was able to complete all except this part above, I don't see a name field to enter anything in? can you screen shot some of this in more detail. thanks again!


    also, would you screen shot it in action as to what it will look like when it actually works?

  • Quote

    I was able to complete all except this part above, I don't see a name field to enter anything in? can you screen shot some of this in more detail. thanks again!

    Hopefully you don't mean that you don't see the Endpoint name in the /etc/icinga2/repository.d/endpoints/ directory.


    The screenshot already exists in my previous post, but here it is again. I've put an additional green box around the field where you need to enter your Endpoint name.




    Here's what it looks like "in action":




    It doesn't execute because I have not installed SNMP on that server yet, and don't have a need for it as of yet. I know as soon as I do that, the plugin will execute though. I only wrote it out now because I wanted to help ya out!


    So, where are you now? How is it coming along?

  • Did you ever run this command on your backend?


    icinga2 node update-config


    This creates host, service, endpoint, etc. definitions for the agents that you have deployed on your network (and throws the definitions into /etc/icinga2/repository.d). Let me know the output of this command once you run it.

  • could i re-generate a setup ticket and re-install the agent? i am not sure i had those checked

  • I have tried re-issuing a token key and re-installed the agent with selected options as shown in your screen shot. ran the "service icing2 reload" and "icinga node update-config" but still getting the same results.


    when director deploys the hosts that are added, where on the backend is that config file saved to?

  • I really am unsure at this point. I wish I could see your environment for myself. Perhaps you could get some more help by reintroducing your problem in a new thread, summarizing all the information in this thread?