Skip to content

Commit

Permalink
Merge pull request kaorimatz#15 from murrant/fixes
Browse files Browse the repository at this point in the history
Mix fixes
  • Loading branch information
laf authored Nov 15, 2018
2 parents 94084a1 + c9f9cd8 commit 2a9a0db
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
7 changes: 6 additions & 1 deletion centos-7.5-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@
"shutdown_command": "sudo systemctl poweroff",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{user `memory`}}"],
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"]
["modifyvm", "{{.Name}}", "--cpus", "{{user `cpus`}}"],
["modifyvm", "{{.Name}}", "--audio", "none"],
["modifyvm", "{{.Name}}", "--usb", "off"],
["modifyvm", "{{.Name}}", "--vram", "12"],
[ "modifyvm", "{{.Name}}", "--natpf1", "ssh,tcp,,2023,,22" ],
[ "modifyvm", "{{.Name}}", "--natpf1", "http,tcp,,8080,,80" ]
],
"export_opts":
[
Expand Down
18 changes: 11 additions & 7 deletions scripts/centos/librenms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ allow httpd_t self:capability net_raw;
allow httpd_t self:rawip_socket { getopt create setopt write read };
EOF'

sudo checkmodule -M -m -o http_fping.mod /tmp/http_fping.tt
sudo semodule_package -o http_fping.pp -m http_fping.mod
sudo semodule -i http_fping.pp
sudo rm -f /tmp/http_fping.tt
sudo checkmodule -M -m -o /tmp/http_fping.mod /tmp/http_fping.tt
sudo semodule_package -o /tmp/http_fping.pp -m /tmp/http_fping.mod
sudo semodule -i /tmp/http_fping.pp
sudo rm -f /tmp/http_fping.tt /tmp/http_fping.pp /tmp/http_fping.mod

sudo firewall-cmd --zone public --add-service http
sudo firewall-cmd --permanent --zone public --add-service http
Expand Down Expand Up @@ -116,7 +116,6 @@ sudo bash -c 'cat << EOF > /etc/my.cnf.d/server.cnf
[server]
innodb_file_per_table=1
lower_case_table_names=0
sql-mode=""
EOF'

sudo systemctl restart mariadb
Expand All @@ -138,8 +137,12 @@ sudo bash -c "echo '\$config[\"fping\"] = \"/usr/sbin/fping\";' >> /opt/librenms
sudo bash -c "echo '\$config[\"rrdcached\"] = \"unix:/var/run/rrdcached/rrdcached.sock\";' >> /opt/librenms/config.php"
sudo bash -c "echo '\$config[\"update_channel\"] = \"release\";' >> /opt/librenms/config.php"

sudo rm /etc/snmp/snmpd.conf
sudo bash -c "echo 'rocommunity public 127.0.0.1' > /etc/snmp/snmpd.conf"
sudo bash -c 'cat <<EOF > /etc/snmp/snmpd.conf
rocommunity public 127.0.0.1
extend distro /usr/bin/distro
extend hardware "/bin/cat /sys/devices/virtual/dmi/id/product_name"
extend manufacturer "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor"
EOF'
sudo curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
sudo chmod +x /usr/bin/distro
sudo systemctl restart snmpd
Expand All @@ -153,6 +156,7 @@ sudo /usr/bin/php /opt/librenms/adduser.php librenms D32fwefwef 10

sudo git clone https://github.com/librenms-plugins/Weathermap.git /opt/librenms/html/plugins/Weathermap/
echo "INSERT INTO plugins SET plugin_name = 'Weathermap', plugin_active = 1;" | mysql -u root librenms
chcon -R -t httpd_cache_t /opt/librenms/html/plugins/Weathermap/

sudo cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms

Expand Down
9 changes: 6 additions & 3 deletions scripts/ubuntu/librenms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ sudo bash -c 'cat << EOF > /etc/mysql/mariadb.conf.d/50-server.cnf
[server]
innodb_file_per_table=1
lower_case_table_names=0
sql-mode=""
EOF'

sudo systemctl enable mysql
Expand All @@ -97,8 +96,12 @@ sudo sed -i "s/PASSWORD/${mysql_pass}/g" /opt/librenms/config.php
sudo bash -c "echo '\$config[\"rrdcached\"] = \"unix:/var/run/rrdcached/rrdcached.sock\";' >> /opt/librenms/config.php"
sudo bash -c "echo '\$config[\"update_channel\"] = \"release\";' >> /opt/librenms/config.php"

sudo rm /etc/snmp/snmpd.conf
sudo bash -c "echo 'rocommunity public 127.0.0.1' > /etc/snmp/snmpd.conf"
sudo bash -c 'cat <<EOF > /etc/snmp/snmpd.conf
rocommunity public 127.0.0.1
extend distro /usr/bin/distro
extend hardware "/bin/cat /sys/devices/virtual/dmi/id/product_name"
extend manufacturer "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor"
EOF'
sudo curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
sudo chmod +x /usr/bin/distro
sudo systemctl restart snmpd
Expand Down
4 changes: 3 additions & 1 deletion ubuntu-18.04-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
["modifyvm", "{{.Name}}", "--vram", "12"],
["modifyvm", "{{.Name}}", "--vrde", "off"],
["modifyvm", "{{.Name}}", "--memory", "{{ user `memory` }}"],
["modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}"]
["modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}"],
[ "modifyvm", "{{.Name}}", "--natpf1", "ssh,tcp,,2023,,22" ],
[ "modifyvm", "{{.Name}}", "--natpf1", "http,tcp,,8080,,80" ]
],
"virtualbox_version_file": ".vbox_version",
"output_directory": "output-ubuntu-18.04-amd64-{{build_type}}",
Expand Down

0 comments on commit 2a9a0db

Please sign in to comment.