Skip to content

Commit ddec392

Browse files
authored
Create a Script To add Nagios Host Groups (#2801)
* Create a Script To add Nagios Host Groups * changing the file name * Refactoring
1 parent 9e96d86 commit ddec392

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
echo "enter the hostgroup name"
4+
read hostgroup_name
5+
6+
echo "enter the hostgroup alias"
7+
read hostgroup_alias
8+
9+
echo "enter enter the hostgroup members"
10+
read hostgroup_members
11+
12+
echo "define hostgroup{" >> /usr/local/nagios/etc/objects/hostgroups.cfg
13+
echo " hostgroup_name $hostgroup_name" >> /usr/local/nagios/etc/objects/hostgroups.cfg
14+
echo " alias $hostgroup_alias" >> /usr/local/nagios/etc/objects/hostgroups.cfg
15+
echo " members $hostgroup_members" >> /usr/local/nagios/etc/objects/hostgroups.cfg
16+
echo " }" >> /usr/local/nagios/etc/objects/hostgroups.cfg

0 commit comments

Comments
 (0)