<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rhencke</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rhencke"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Rhencke"/>
	<updated>2026-04-25T23:42:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Zabbix_-_cgi_and_mysql&amp;diff=15678</id>
		<title>Zabbix - cgi and mysql</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Zabbix_-_cgi_and_mysql&amp;diff=15678"/>
		<updated>2019-01-24T16:25:58Z</updated>

		<summary type="html">&lt;p&gt;Rhencke: Fix dash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The purpose of this document is to assist in installing the Zabbix server software and Zabbix agent on the Alpine Linux operating system. Instructions on how to configure and use Zabbix - as well as many useful tutorials - can be found at http://www.zabbix.com.&lt;br /&gt;
&lt;br /&gt;
{{Note|The minimum required version of Alpine Linux required to install Zabbix is Alpine 2.2. this guide has been updated to zabbix 3.0}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Install Lighttpd, and PHP =&lt;br /&gt;
&lt;br /&gt;
{{:Setting Up Lighttpd With FastCGI}}&lt;br /&gt;
&lt;br /&gt;
= Configure PostgreSQL =&lt;br /&gt;
&lt;br /&gt;
Install PostgreSQL&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add postgresql postgresql-client}}&lt;br /&gt;
&lt;br /&gt;
Now configure PostgreSQL:&lt;br /&gt;
{{Cmd|/etc/init.d/postgresql setup&lt;br /&gt;
/etc/init.d/postgresql start&lt;br /&gt;
rc-update add postgresql}}&lt;br /&gt;
&lt;br /&gt;
= Install Zabbix =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add zabbix zabbix-pgsql zabbix-webif zabbix-setup}}&lt;br /&gt;
&lt;br /&gt;
Now we need to set up the zabbix database. Substitute &#039;*********&#039; in the example below for a real password:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;psql -U postgres&lt;br /&gt;
postgres=# create user zabbix with password &#039;*********&#039;;&lt;br /&gt;
postgres=# create database zabbix owner zabbix;&lt;br /&gt;
postgres=# \q&lt;br /&gt;
cd /usr/share/zabbix/database/postgresql&lt;br /&gt;
cat schema.sql | psql -U zabbix zabbix&lt;br /&gt;
cat images.sql | psql -U zabbix zabbix&lt;br /&gt;
cat data.sql | psql -U zabbix zabbix&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Create a softlink for the Zabbix web-frontend files:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rm /var/www/localhost/htdocs -R&lt;br /&gt;
ln -s /usr/share/webapps/zabbix /var/www/localhost/htdocs}}&lt;br /&gt;
&lt;br /&gt;
Edit PHP configuration to satisfy some zabbix requirements. Edit /etc/php/php.ini and configure the following values at least:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Max_execution_time = 600&lt;br /&gt;
Expose_php = off&lt;br /&gt;
Date.timezone = &amp;lt;insert your timezone here&amp;gt;&lt;br /&gt;
post_max_size = 32M&lt;br /&gt;
upload_max_filesize = 16M&lt;br /&gt;
max_input_time = 600&lt;br /&gt;
memory_limit = 256M&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the following entries in /etc/zabbix/zabbix_server.conf, where DBPassword is the password chosen for the database above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DBName=zabbix&lt;br /&gt;
&lt;br /&gt;
# Database user&lt;br /&gt;
&lt;br /&gt;
DBUser=zabbix&lt;br /&gt;
&lt;br /&gt;
# Database password&lt;br /&gt;
# Comment this line if no password used&lt;br /&gt;
&lt;br /&gt;
DBPassword=*********&lt;br /&gt;
&lt;br /&gt;
FpingLocation=/usr/sbin/fping&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start Zabbix server:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add zabbix-server&lt;br /&gt;
/etc/init.d/zabbix-server start}}&lt;br /&gt;
&lt;br /&gt;
Fix permissions on conf directory.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|chown -R lighttpd /usr/share/webapps/zabbix/conf}}&lt;br /&gt;
&lt;br /&gt;
You should now be able to browse to the Zabbix frontend: http://yourservername/.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
You should now be able to browse to the Zabbix setup frontend: http://yourserverip/instal.php.&lt;br /&gt;
&lt;br /&gt;
Follow the setup instructions to configure Zabbix, supplying the database information used above.&lt;br /&gt;
&lt;br /&gt;
After setup, login using: Login name: &#039;&#039;&#039;Admin&#039;&#039;&#039; Password:&#039;&#039;&#039;zabbix&#039;&#039;&#039;. (as described at http://www.zabbix.com/documentation/1.8/manual/installation)&lt;br /&gt;
&lt;br /&gt;
Finally, Zabbix requires special permissions to use the fping binary.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|chmod u+s /usr/sbin/fping}}&lt;br /&gt;
&lt;br /&gt;
= Install Zabbix Agent on Monitored Servers =&lt;br /&gt;
&lt;br /&gt;
Zabbix can monitor almost any operating system, including Alpine Linux hosts. Complete the following steps to install the Zabbix agent on Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
{{Note|Support to allow zabbix-agentd to view running processes on Alpine Linux has been added since linux-grsec-2.6.35.9-r2. Please ensure you have that kernel installed prior to attempting to run zabbix-agentd.}}&lt;br /&gt;
&lt;br /&gt;
Ensure that the readproc group exists (support added since alpine-baselayout-2.0_rc1-r1), by adding the following line to /etc/group:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|readproc:x:30:zabbix}}&lt;br /&gt;
&lt;br /&gt;
Install the agent package:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add zabbix-agent}}&lt;br /&gt;
&lt;br /&gt;
Edit the /etc/zabbix/zabbix_agentd.conf file and configure at least the following option:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Server=&amp;lt;ip or hostname of zabbix server&amp;gt;&lt;br /&gt;
Hostname=&amp;lt;ip or hostname of zabbix agent&amp;gt;&lt;br /&gt;
ListenPort=10050&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the zabbix-agent:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add zabbix-agentd&lt;br /&gt;
/etc/init.d/zabbix-agentd start}}&lt;br /&gt;
&lt;br /&gt;
In case you want to monitor using SNMP agent on remote machines you have to add these packages on zabbix server:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add net-snmp net-snmp-tools}}&lt;br /&gt;
&lt;br /&gt;
And add these packages on remote machines:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add net-snmp }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Optional: Crash course in adding hosts, checks, and notifications =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; This is optional since it&#039;s not specific to Alpine Linux, but I wanted a couple notes for how to perform a simple check on a server that doesn&#039;t have the agent installed on it, and be notified on state changes.&lt;br /&gt;
&lt;br /&gt;
Administration -&amp;gt; Media Types -&amp;gt; Email&lt;br /&gt;
* Setup server, helo, email from address&lt;br /&gt;
&lt;br /&gt;
Administration -&amp;gt; Users&lt;br /&gt;
* Setup each user who&#039;ll get notified, make sure they have media type &amp;quot;Email&amp;quot; added with their address&lt;br /&gt;
&lt;br /&gt;
Configuration -&amp;gt; Hosts -&amp;gt; Create host&lt;br /&gt;
* In Linux Servers hostgroup&lt;br /&gt;
* Define dns name, ip, connect by IP&lt;br /&gt;
* If the machine is a simple networking device that will only be monitored using SNMP, add it to Template_SNMPv2_Device, and you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
Configuration -&amp;gt; Templates -&amp;gt; Create template&lt;br /&gt;
* Give it a name (Template_Alpine_Linux_Infra_HTTP)&lt;br /&gt;
* In Templates group&lt;br /&gt;
&lt;br /&gt;
Configuration -&amp;gt; Templates -&amp;gt; Template_Alpine_Linux_Infra_HTTP -&amp;gt; Items&lt;br /&gt;
* Create Item&lt;br /&gt;
* Host: Template_Alpine_Linux_Infra_HTTP&lt;br /&gt;
* Description: HTTP Basic Check&lt;br /&gt;
* Type: Simple_check&lt;br /&gt;
* Key: http,80&lt;br /&gt;
&lt;br /&gt;
Configuration -&amp;gt; Templates -&amp;gt; Template_Alpine_Linux_Infra_HTTP -&amp;gt; Triggers&lt;br /&gt;
* Create Trigger&lt;br /&gt;
* Name: &amp;quot;HTTP Trigger&amp;quot;&lt;br /&gt;
* Expression: {Template_Alpine_Linux_Infra_HTTP:http,80.last(0)}#1&lt;br /&gt;
* Severity: High&lt;br /&gt;
&lt;br /&gt;
Configuration -&amp;gt; Actions -&amp;gt; &lt;br /&gt;
* Create Action&lt;br /&gt;
* name: Email notifications&lt;br /&gt;
* Event source: triggers&lt;br /&gt;
* Default Subject: add &amp;quot;{HOST.DNS}:&amp;quot; to the beginning&lt;br /&gt;
* Default message: add &amp;quot;{HOST.DNS}:&amp;quot; to the beginning&lt;br /&gt;
* Conditions: make host have to be from &amp;quot;Linux Servers&amp;quot; hostgroup, and Template_Alpine_Linux_Infra_HTTP:HTTP trigger&amp;quot; is not 1&lt;br /&gt;
* Email affected users&lt;br /&gt;
&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:PHP]]&lt;br /&gt;
[[Category:SQL]]&lt;/div&gt;</summary>
		<author><name>Rhencke</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=12865</id>
		<title>Wi-Fi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=12865"/>
		<updated>2016-06-19T15:53:12Z</updated>

		<summary type="html">&lt;p&gt;Rhencke: Undo revision 12864 by Rhencke (talk) - ugh, I was wrong&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to set up a wireless network connection with WPA encryption.&lt;br /&gt;
&lt;br /&gt;
First make sure your wireless drivers are loded properly. (if you are using a Broadcom chipset, see note at the end of this post.)&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|wireless-tools}} and {{Pkg|wpa_supplicant}}.&lt;br /&gt;
{{Cmd|apk add wireless-tools wpa_supplicant}}&lt;br /&gt;
&lt;br /&gt;
Bring the link up so we can look for wireless networks. (An error here means you probably need extra drivers/firmware.)&lt;br /&gt;
{{Cmd|ip link set wlan0 up}}&lt;br /&gt;
&lt;br /&gt;
Find a network to connect to. Look for the ESSID. In this example we will use the ESSID &amp;quot;MyNet&amp;quot;.&lt;br /&gt;
{{Cmd|iwlist wlan0 scanning}}&lt;br /&gt;
&lt;br /&gt;
Lets set the ESSID:&lt;br /&gt;
{{Cmd|iwconfig wlan0 essid MyNet}}&lt;br /&gt;
&lt;br /&gt;
We need to create a shared key for wpa_supplicant.&lt;br /&gt;
{{Cmd|wpa_passphrase MyNet &amp;gt; wpa.conf}}&lt;br /&gt;
It will wait for the password from stdin. Enter the password and enter. Now you will have a {{Path|wpa.conf}} file with the preshared key.&lt;br /&gt;
&lt;br /&gt;
Start wpa_supplicant with the generated config:&lt;br /&gt;
{{Cmd|wpa_supplicant -Dwext -iwlan0 -c ./wpa.conf}}&lt;br /&gt;
&lt;br /&gt;
From another console, start dhcpcd:&lt;br /&gt;
{{Cmd|udhcpc -i wlan0}}&lt;br /&gt;
&lt;br /&gt;
You should get an IP address.&lt;br /&gt;
&lt;br /&gt;
You then want to make the connection process automatic on boot-up.  Open {{Path|/etc/network/interfaces}} and add the following stanza:&lt;br /&gt;
 auto wlan0&lt;br /&gt;
 iface wlan0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
You will also need to set wpa_supplicant to start automatically on boot:&lt;br /&gt;
{{Cmd|rc-update add wpa_supplicant boot}}&lt;br /&gt;
&lt;br /&gt;
Next, create {{Path|/etc/wpa_supplicant/}} (permissions of 755 with root:root are fine), and move {{Path|wpa.conf}} into that folder, renaming it to {{Path|wpa_supplicant.conf}}.&lt;br /&gt;
&lt;br /&gt;
Reboot and check that you are associated with the access point:&lt;br /&gt;
{{Cmd|iwconfig wlan0}}&lt;br /&gt;
and check that you got a DHCP lease:&lt;br /&gt;
{{Cmd|ifconfig wlan0 {{!}} grep addr}}&lt;br /&gt;
&lt;br /&gt;
{{Note|BROADCOM WIFI CHIPSET USERS will need to compile the firmware manually for their chipset.  First, apk add alpine-sdk, then git clone aports from git.alpinelinux.org, switch to the aports/non-free/b43-firmware folder, then run abuild -r.  Install the generated apk file.  Run fwcutter, and you should be good to go.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Rhencke</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=12864</id>
		<title>Wi-Fi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=12864"/>
		<updated>2016-06-19T07:20:58Z</updated>

		<summary type="html">&lt;p&gt;Rhencke: Instructions did not work unless udhcpd was added.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to set up a wireless network connection with WPA encryption.&lt;br /&gt;
&lt;br /&gt;
First make sure your wireless drivers are loded properly. (if you are using a Broadcom chipset, see note at the end of this post.)&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|wireless-tools}} and {{Pkg|wpa_supplicant}}.&lt;br /&gt;
{{Cmd|apk add wireless-tools wpa_supplicant}}&lt;br /&gt;
&lt;br /&gt;
Bring the link up so we can look for wireless networks. (An error here means you probably need extra drivers/firmware.)&lt;br /&gt;
{{Cmd|ip link set wlan0 up}}&lt;br /&gt;
&lt;br /&gt;
Find a network to connect to. Look for the ESSID. In this example we will use the ESSID &amp;quot;MyNet&amp;quot;.&lt;br /&gt;
{{Cmd|iwlist wlan0 scanning}}&lt;br /&gt;
&lt;br /&gt;
Lets set the ESSID:&lt;br /&gt;
{{Cmd|iwconfig wlan0 essid MyNet}}&lt;br /&gt;
&lt;br /&gt;
We need to create a shared key for wpa_supplicant.&lt;br /&gt;
{{Cmd|wpa_passphrase MyNet &amp;gt; wpa.conf}}&lt;br /&gt;
It will wait for the password from stdin. Enter the password and enter. Now you will have a {{Path|wpa.conf}} file with the preshared key.&lt;br /&gt;
&lt;br /&gt;
Start wpa_supplicant with the generated config:&lt;br /&gt;
{{Cmd|wpa_supplicant -Dwext -iwlan0 -c ./wpa.conf}}&lt;br /&gt;
&lt;br /&gt;
From another console, start dhcpcd:&lt;br /&gt;
{{Cmd|udhcpc -i wlan0}}&lt;br /&gt;
&lt;br /&gt;
You should get an IP address.&lt;br /&gt;
&lt;br /&gt;
You then want to make the connection process automatic on boot-up.  Open {{Path|/etc/network/interfaces}} and add the following stanza:&lt;br /&gt;
 auto wlan0&lt;br /&gt;
 iface wlan0 inet dhcp&lt;br /&gt;
&lt;br /&gt;
You will also need to set wpa_supplicant and udhcpd to start automatically on boot:&lt;br /&gt;
{{Cmd|rc-update add wpa_supplicant boot&lt;br /&gt;
rc-update add udhcpd boot&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Next, create {{Path|/etc/wpa_supplicant/}} (permissions of 755 with root:root are fine), and move {{Path|wpa.conf}} into that folder, renaming it to {{Path|wpa_supplicant.conf}}.&lt;br /&gt;
&lt;br /&gt;
Reboot and check that you are associated with the access point:&lt;br /&gt;
{{Cmd|iwconfig wlan0}}&lt;br /&gt;
and check that you got a DHCP lease:&lt;br /&gt;
{{Cmd|ifconfig wlan0 {{!}} grep addr}}&lt;br /&gt;
&lt;br /&gt;
{{Note|BROADCOM WIFI CHIPSET USERS will need to compile the firmware manually for their chipset.  First, apk add alpine-sdk, then git clone aports from git.alpinelinux.org, switch to the aports/non-free/b43-firmware folder, then run abuild -r.  Install the generated apk file.  Run fwcutter, and you should be good to go.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Rhencke</name></author>
	</entry>
</feed>