Distributed Monitoring from command line

Hi all,
i have a distribute monitoring infrastructure, is there a way to get the information from the host monitored in the remote site via command line while executing the command from the central site ?

Let me explain better: so, by using “cmk -l --all-sites” im able to see the hostname of every server monitored from the central site, is there a way to execute the command “cmk -d <>” from the central site and retrieving information of host located in the remote site ? This command (cmk -d) have and option like --all-sites that isnt specified in the help of the command ?

I thought abount using api’s, but i noticed that the hostname information isnt provided.

Thanks in advance.

Regards,
Davide

Quick update: i’ve found out that with livestatus query i can perform a select over the Host table and retrieve the mk_inventory field wich cointains the HW / SW inventory ( In the HW / SW Inventory is found the hostlname of the server monitored ).

Here the command i used:
OMD[mysite]:~$ lq “GET hosts\nColumns: name mk_inventory”

Unfortunately, for almost every host, it appears that the field mk_invetory is empty. I tried to install the plugin mk_invetory.linux and to add the rule under the “HW / SW Invetory Rules” but nothing changed.
For hosts where it works I did not make any changes, the field was already populated without having to install the plugin and without creating the rule.

image

How do i make visible the “Show HW / SW Inventory of this host” option under the action menù ?

perhaps I dont understand, but HW/SW needs an updated agent that contain the plugin, as you are not using enterprise you need to configure that yourself, its included in the docs.

now why do you want to run this via the command line?

Hi Anders,
here some background: i’ve a distributed monitoring infrastructure and i want to create a list for every host monitored. The list will include the IP of the host and his real hostname. Once the data are collected they need to be uploaded to phpIPAM so i can keep track of the ip address used and the one free.

I found out that through the HW/SW Invetory and is APIs i can get the information that i need. So i was trying to enable this feature but even if i added the plugin under the specified directory and ive created the rule i still cant see the option under the action menù.

I believe that this is only one way to complete the task, so if someone knows how to fix the HW/SW problem or an easier way to retrive these information (IP, hostname), would be really appreciated.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.