Ho can I do a reports of selective hosts and their services?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
donvito7
Posts: 5
Joined: Tue Oct 30, 2012 11:56 am

Ho can I do a reports of selective hosts and their services?

Post by donvito7 »

Basically I need to create a weekly report of our UpTime.

We only concern about our production site of it. This is ping, http from one host, ping, http from other, ping, http and Myqsl

Is any way I can I create just the group of these services and hosts to create one click report?

Many thanx for any hints!
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Ho can I do a reports of selective hosts and their servi

Post by agriffin »

Just put these into a service group and then run the report on that service group.
donvito7
Posts: 5
Joined: Tue Oct 30, 2012 11:56 am

Re: Ho can I do a reports of selective hosts and their servi

Post by donvito7 »

yes, but how the config would like if I need:

1. ping from server1
2. http from server1
3. ping from server2
4. http from server2
5. ping from server3
6. http from server3
7. Mysql from server3
8. Oracle from server4
9. servicexyz from server4
10. serviceABC from server4

I have created a file: servicegroups.cfg

define serviceroup{

servicegroup_name Ping & http

alias Ping&http

members server1,server2
check_command check_ping!150.0,25%!500.0,60%
check_command check_http
}


Is it correct?
donvito7
Posts: 5
Joined: Tue Oct 30, 2012 11:56 am

Re: Ho can I do a reports of selective hosts and their servi

Post by donvito7 »

I have created a file "servicegroups.cfg"


define serviceroup{

servicegroup_name Ping & http

alias Ping&http

members server1,check_ping!150.0,25%!500.0,60%,server2,check_http
}

If I restart the service I still can see "There are no service groups defined."

Is anything else I need to do to make it work?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Ho can I do a reports of selective hosts and their servi

Post by mguthrie »

Is the servicegroups.cfg file being seen by the main nagios.cfg file?
donvito7
Posts: 5
Joined: Tue Oct 30, 2012 11:56 am

Re: Ho can I do a reports of selective hosts and their servi

Post by donvito7 »

I have added this line

cfg_file=/etc/nagios/servicegroups.cfg

but when I restart the service it fails.
Running configuration check... FAILED! Restart aborted. Check your Nagios configuration.
donvito7
Posts: 5
Joined: Tue Oct 30, 2012 11:56 am

Re: Ho can I do a reports of selective hosts and their servi

Post by donvito7 »

I have got:

# You can split other types of object definitions across several
# config files if you wish (as done here), or keep them all in a
# single config file.

#cfg_file=/etc/nagios/contactgroups.cfg
#cfg_file=/etc/nagios/contacts.cfg
#cfg_file=/etc/nagios/dependencies.cfg
#cfg_file=/etc/nagios/escalations.cfg
cfg_file=/etc/nagios/hosts.cfg
cfg_file=/etc/nagios/external.cfg
cfg_file=/etc/nagios/hostgroups.cfg
cfg_file=/etc/nagios/services.cfg
cfg_file=/etc/nagios/servicegroups.cfg
#cfg_file=/etc/nagios/timeperiods.cfg

but the service restart fails even if the file is empty or hashed out.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ho can I do a reports of selective hosts and their servi

Post by scottwilkerson »

what are the permissions on?

Code: Select all

ls -l /etc/nagios/servicegroups.cfg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked