Page 1 of 1

Using servicegroups as parameter in status.cgi

Posted: Tue Oct 15, 2019 10:59 am
by vlakshman
Guys,

My Host & Service Architecture are as follows:

There are 3 hosts, Host A,B,C
Host A has service monitors 'Service A1, Service A2' for Client A
Host B has service monitors 'Service B1, Service B2' for Client B
Host C has service monitors 'Service A3, Service B3' for Client A & B.

Services A1 & A3 are grouped under servicegroup 'GA'
Services B1 & B3 are grouped under servicegroup 'GB'

When Client A logs in he should see services A1,A2 (from Host A) & A3 (from Host C)
When Client B logs in he should see services B1,B2 (from Host A) & B3 (from Host C)

To accomplish this user specific display following is the contacts defined:

For Host A --> Contacts= Client A
For Host B --> Contacts= Client B
For Host C --> Contacts= dummy user , Contacts for Service A3 = Client A, Contacts for Service B3 = Client B


I need a custom page to display status based on servicegroups.
(ie) servicegroup page 'GA' should display services 'A1 & A3'
servicegroup page 'GB' should display services 'B1 & B3'

Problem:
Querying "http://ip/nagios/cgi-bin/status.cgi?ser ... style=grid" returns only service A1 & not A3
Querying "http://ip/nagios/cgi-bin/status.cgi?ser ... style=grid" returns only service B1 & not B3

I don't want to use servicefilter parameter & would like to handle it by passing servicegroup parameter to status.cgi.

Any thoughts on how we can accomplish this?

Re: Using servicegroups as parameter in status.cgi

Posted: Tue Oct 15, 2019 12:25 pm
by scottwilkerson
Can Client A see A1 & A3 on the service detail page?

If not, then the contact must not be set on service A3 if they cannot see it.

Re: Using servicegroups as parameter in status.cgi

Posted: Fri Oct 18, 2019 2:49 am
by vlakshman
Yes. No problem in contacts.
I got it working with a tweak in style.

Here's what I did:

For Host A --> Contacts= Client A
For Host B --> Contacts= Client B
For Host C --> Contacts= dummy user , Contacts for Service A3 = Client A, Contacts for Service B3 = Client B


Bind Services:
a) A1 & A3 to servicegroup GA
b) B1 & B3 to servicegroup GB

With above setting:

When Client A logins, he can see:
a) 'Host A' in Hosts
b) Services A1,A2 & A3 in Services

Created a custom link called 'GA' and added "http://ip/nagios/cgi-bin/status.cgi?ser ... yle=detail"
to get a detailed view of services grouped under servicegroup 'GA'.

NOTE:
instead of using style=grid, I had to use style=detail to get it working

Re: Using servicegroups as parameter in status.cgi

Posted: Fri Oct 18, 2019 7:44 am
by scottwilkerson
vlakshman wrote:Yes. No problem in contacts.
I got it working with a tweak in style.
Great!

Thanks for sharing your solution

Locking thread