Can't add "all" hosts under one group
-
@Hanz can you add a random 5 to the group successfully?
-
@Wayne-Workman random five works fine
-
@Hanz I can probably make a SQL statement that will do the group add for you in the mean time, but we do need to get this figured out. Can you check the apache error logs and mysql error logs?
-
@Wayne-Workman here is the apache error log from the instance.
[Mon Feb 22 08:39:23.847739 2016] [:error] [pid 5050] [client 10.72.2.46:60053] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://10.72.3.50/fog/management/index.php?node=group&sub=membership&id=63
-
@Hanz ok can you try what the error suggests?
Here’s a command to find that file:
find / | grep /php.ini
-
@Wayne-Workman sry didn’t see that error before when looking…changed it to 2500 and rebooted server…still getting same error.
[Mon Feb 22 08:39:23.847739 2016] [:error] [pid 5050] [client 10.72.2.46:60053] PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0, referer: http://10.72.3.50/fog/management/index.php?node=group&sub=membership&id=63
-
@Hanz Sure you got the right file? Double check for typos? It should work…
-
@Wayne-Workman I’ve got /etc/php.ini , /etc/php.ini.rpmnew, /usr/share/doc/php-common/php.ini-production, and /usr/share/doc/php-common/php.ini-development.
I changed the first one and double checked the line to make sure it was saved.
-
@Hanz Ok then… I don’t know what is causing it then. Stand by - I’ve about got a script done that does what you want.
-
@Wayne-Workman I could do this with phpMyAdmin right ? I dunno why I didn’t think of that. Anyways I’ll go that route, but leave this just so the devs know this is going on, at least on 6321.
Also running php 7.0 from remi
-
@Hanz This script does what you want.
# This script adds all fog hosts to the below specified group name. # the group name is case sensitive. groupName=My-caseSensitive-Test-group-Name fogsettings=/opt/fog/.fogsettings snmysqluser="$(grep 'snmysqluser=' $fogsettings | cut -d \' -f2 )" snmysqlpass="$(grep 'snmysqlpass=' $fogsettings | cut -d \' -f2 )" snmysqlhost="$(grep 'snmysqlhost=' $fogsettings | cut -d \' -f2 )" if [[ $snmysqlhost != "" ]]; then hostIDs=$(mysql -s -h$snmysqlhost -u$snmysqluser -p$snmysqlpass -D fog -e "Select hostID from hosts") groupID=$(mysql -s -h$snmysqlhost -u$snmysqluser -p$snmysqlpass -D fog -e "Select groupID from groups where groupName = '$groupName'") for i in ${hostIDs[@]}; do mysql -s -h$snmysqlhost -u$snmysqluser -p$snmysqlpass -D fog -e "insert into groupMembers (gmHostID,gmGroupID) values (${i},$groupID)" done elif [[ $snmysqlpass != "" ]]; then hostIDs=$(mysql -s -u$snmysqluser -p$snmysqlpass -D fog -e "Select hostID from hosts") groupID=$(mysql -s -u$snmysqluser -p$snmysqlpass -D fog -e "Select groupID from groups where groupName = '$groupName'") for i in ${hostIDs[@]}; do mysql -s -u$snmysqluser -p$snmysqlpass -D fog -e "insert into groupMembers (gmHostID,gmGroupID) values (${i},$groupID)" done else hostIDs=$(mysql -s -D fog -e "Select hostID from hosts") groupID=$(mysql -s -D fog -e "Select groupID from groups where groupName = '$groupName'") for i in ${hostIDs[@]}; do mysql -s -D fog -e "insert into groupMembers (gmHostID,gmGroupID) values (${i},$groupID)" done fi