Grouping
Grouping
Hi all,
I have read nagios documentation and i get the point of the grouping hosts and other but i need a little help. I would like to make a template and group of hosts and services, for example i would like to have 10 PC-servers to have (i dont know) 5 services like UpTime, CPU, Bandwith, SSH for example and HTTP. Also i would like to do this on Routers, i have 50 routers and to have them in one group and 10 same services to get all of them like Port UPTIME ....
And another problem i can think of this shame is the community string/passwords ... because i use different password and community string on almost all machines.
Any suggestions ?
I have read nagios documentation and i get the point of the grouping hosts and other but i need a little help. I would like to make a template and group of hosts and services, for example i would like to have 10 PC-servers to have (i dont know) 5 services like UpTime, CPU, Bandwith, SSH for example and HTTP. Also i would like to do this on Routers, i have 50 routers and to have them in one group and 10 same services to get all of them like Port UPTIME ....
And another problem i can think of this shame is the community string/passwords ... because i use different password and community string on almost all machines.
Any suggestions ?
Re: Grouping
You can do this a number of ways. The easiest, most direct way, would be to use hostgroups. Create a hostgroup, then create services and add them to the hostgroup. Then add whatever hosts that should have those service checks to the hostgroup. Rinse and repeat for each set of services.
You could also do this through templates. Create a set of services and add them to a servicegroup. Then create a service template and add the servicegroup to it. Then create a hostgroup and add that to the template. Then add hosts to the host group and they will all inherit the checks from the template.
You could also do this through templates. Create a set of services and add them to a servicegroup. Then create a service template and add the servicegroup to it. Then create a hostgroup and add that to the template. Then add hosts to the host group and they will all inherit the checks from the template.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Grouping
Hi abrist, and tnx for reply ...
that's good idea, ill try some things.. now im trying to work with different community string on each host, and i need help here. For example: i have create in template like this...
define hostgroup{
name group1
use generic-host
members PC1,PC2,PC3
}
and
define servicegroup{
name servicegroup1
use generic-service
members PC1,Uptime,PC2,Uptime,PC3,Uptime
}
and now im wondering is there a way to put different community string/password for eche PC and combine with macro to passed for each PC ?
that's good idea, ill try some things.. now im trying to work with different community string on each host, and i need help here. For example: i have create in template like this...
define hostgroup{
name group1
use generic-host
members PC1,PC2,PC3
}
and
define servicegroup{
name servicegroup1
use generic-service
members PC1,Uptime,PC2,Uptime,PC3,Uptime
}
and now im wondering is there a way to put different community string/password for eche PC and combine with macro to passed for each PC ?
Re: Grouping
Well i gees i wont need explanation i found the solution ... and here it is....
i made in template.cfg file my definition about host ...
then in the windows.cfg file i made hostgroup and define the hosts
and in the commands.cfg
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 1354 -s $_HOSTSNM$
}
so thats it ... now im trying to group services so if you have any sugestions pls shear ....
i made in template.cfg file my definition about host ...
Code: Select all
define host {
name def-host1
use generic-host
check_period 24x7 ; By default, Windows servers are monitored round the clock
check_interval 5 ; Actively check the server every 5 minutes
retry_interval 3 ; Schedule host check retries at 1 minute intervals - 1
max_check_attempts 10 ; Check each server 10 times (max)
check_command check-host-alive ; Default command to check if servers are "alive"
notification_period 24x7 ; Send notification out at any time - day or night
notification_interval 30 ; Resend notifications every 30 minutes
notification_options d,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
hostgroups windows-for-def-host1 ; Host groups that Windows servers should be a member of
register 0
}Code: Select all
define host{
use def-host1
host_name PC1
alias win 8
address 10.10.10.10
_SNMPCOMMUNITY Test1
}
define hostgroup{
hostgroup_name windows-for-def-host1
alias windows PC's
members PC1,PC2,PC3 ; i think it can do without members ...
}
and the services
define service{
use generic-service
hostgroup_name windows-for-def-host1
service_description Uptime
check_command check_nt!UPTIME
}
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 1354 -s $_HOSTSNM$
}
so thats it ... now im trying to group services so if you have any sugestions pls shear ....
Re: Grouping
You can group services by hostgroups or by servicegroups attached to templates.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Grouping
That is my next think. But what can i do with the service like ifOperStatus.0 - for interface fa 0/0 and ifOperStatus.1 for interface 0/1 etc.... how can i solve this repeating ?
Re: Grouping
You really cannot solve it, as they are technically different service checks. If you have a mib/oid for the overall status of the switch you could, but your switch most likely does not have the option.MPIvan wrote:That is my next think. But what can i do with the service like ifOperStatus.0 - for interface fa 0/0 and ifOperStatus.1 for interface 0/1 etc.... how can i solve this repeating ?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Grouping
I did as grouphost .. i have read somewhere that you can split with a " , " in old versions of nagios here and in some other google search results but nothing work or im doing something wrong ...
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Grouping
Sorry that link does not work, seems to be a paid google book. Could you provide another similar link?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Grouping
I cannot find another link for that book but here is how in the example is written:
This book is Pro Nagios 2.0 and somewhere in google search i have found similar solution, i cannot find that link but if i remember good it was something like ifOperStatus.1,2,3 something like this or similar
.check_snmp -H 10.0.0.4 -C public -o IF_MIB::ifOperStatus.1,IF-MIB::ifOperStatus.2
This book is Pro Nagios 2.0 and somewhere in google search i have found similar solution, i cannot find that link but if i remember good it was something like ifOperStatus.1,2,3 something like this or similar