Hi All,
Hope you are doing well!!!
I want to export a list from Nagios Core with below details:
1. All Host Names with their IP Addresses and Alias.
2. List of services being monitored on All Hosts.
Host List with IP Address
-
s.diwakar1
- Posts: 44
- Joined: Thu Feb 27, 2020 9:45 am
Host List with IP Address
Thanks & Regards,
Diwakar Sharma
Diwakar Sharma
Re: Host List with IP Address
This isn't pretty but it might be usable...
A list of address/host pairs is simple, but getting services and hosts gets a bit tricky if hostgroups are used.
grep address /usr/local/nagios/etc/hosts/* | tr / " " | awk '{print $NF " " $6}' | sed s/.cfg://g
egrep 'alias|address' /usr/local/nagios/etc/hosts/* | tr / " " | awk '{print $NF " " $6}' | sed s/.cfg://g
egrep 'hostgroup_name|host_name' /usr/local/nagios/etc/services/*
A list of address/host pairs is simple, but getting services and hosts gets a bit tricky if hostgroups are used.
grep address /usr/local/nagios/etc/hosts/* | tr / " " | awk '{print $NF " " $6}' | sed s/.cfg://g
egrep 'alias|address' /usr/local/nagios/etc/hosts/* | tr / " " | awk '{print $NF " " $6}' | sed s/.cfg://g
egrep 'hostgroup_name|host_name' /usr/local/nagios/etc/services/*
-
s.diwakar1
- Posts: 44
- Joined: Thu Feb 27, 2020 9:45 am
Re: Host List with IP Address
Hi Gormank,
It's working fine. Can we also export it in file like excel, csv etc?
It's working fine. Can we also export it in file like excel, csv etc?
Thanks & Regards,
Diwakar Sharma
Diwakar Sharma