Zabbix installation and setup

https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages/repository_installation#installing_repository_configuration_package2

Ubuntu 16.04 LTS (xenial):

$ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+xenial_all.deb
$ dpkg -i zabbix-release_3.0-1+xenial_all.deb
$ apt-get update
$ sudo apt-get install zabbix-agent zabbix-server-mysql zabbix-frontend-php snmpd php5.6-mysql php5.6-curl
$ sudo nano /etc/php/5.6/apache2/php.ini

...
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Sao_Paulo
....


$ sudo /etc/init.d/apache2 restart

php info date

Determine what port zabbix listening to. Should be either or all 10050 and 10051. One for agent another for server.
$ sudo netstat -tlnp | grep zabbix
zabbix port listening

Url:
http://localhost/zabbix

Default Username: Admin
Default Password: zabbix

Error Solution: The frontend does not match Zabbix database
zabbix database installation error

You should first populate the database with the sql file provided in /usr/share/doc/zabbix-server-mysql/create.sql

Depending on the size allowed in phpmyadmin its best to import thru the command line. Also this allows to edit the file if any errors (possible 1709)
$ mysql -u root -p zabbix < create.sql

Configure port
If you have the incorrect port set you will get this error
Zabbix server is running
To view the zabbix port (you may need to start zabbix)
$ sudo /etc/init.d/zabbix-agent restart
$ sudo netstat -tlnp | grep zabbix
To change web port
$ sudo nano /etc/zabbix/web/zabbix.conf.php

$ZBX_SERVER      = '192.168.0.13';
$ZBX_SERVER_PORT = '10050';
$ZBX_SERVER_NAME = '';

To change agent port
$ sudo nano /etc/zabbix/zabbix_agentd.conf

### Option: ListenPort
#	Agent will listen on this port for connections from the server.
#
# Mandatory: no
# Range: 1024-32767
# Default:
ListenPort=10050

If you want reinstall zabbix. To get the installation screen
delete /etc/zabbix/web/zabbix.conf.php
or
go to http://localhost/zabbix/setup.php

# comment out the line 'mibs'
$ sudo nano /etc/snmp/snmp.conf

# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loading them by commenting out the following line.
#mibs :

# error log location
/var/log/zabbix/

possible errors

server error:
[Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
solution:
mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'abc123'
$ sudo nano file:/etc/zabbix/zabbix_server.conf

### Option: DBPassword
#	Database password. Ignored for SQLite.
#	Comment this line if no password is used.
#
# Mandatory: no
# Default:
DBPassword=abc123

agent error:
$ tail -f zabbix_agentd.log
failed to accept an incoming connection: connection from "192.168.0.13" rejected, allowed hosts: "127.0.0.1"
solution:
zabbix_agentd.conf 'Server=...' need to match /etc/zabbix/web/zabbix.conf.php '$ZBX_SERVER'
$ sudo nano /etc/zabbix/zabbix_agentd.conf
add 192.168.0.13

 ...
Server=127.0.0.1,192.168.0.13
....
ServerActive=127.0.0.1,192.168.0.13
...

$ sudo /etc/init.d/zabbix-agent restart

sources

http://www.cbt4all.com/2015/01/zabbix-for-beginners-01-installing.html

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-zabbix-to-securely-monitor-remote-servers-on-centos-7

Virtual box Increase disk size

http://trivialproof.blogspot.com.br/2011/01/resizing-virtualbox-virtual-hard-disk.html#expand_partition_on_new_vdi
https://www.howtogeek.com/124622/how-to-enlarge-a-virtual-machines-disk-in-virtualbox-or-vmware/

command example
$ VBoxManage modifyhd /home/user/VirtualBox\ VMs/windows7/windows7.vdi --resize 50000

I had an issue where new memory was not showing up in GParted GUI to be allocated. I cloned the virtual drive and use that one instead and it worked

C sharp (C#) Hello world

create a cs file hello-world.cs and add code.

run the file in cmd
C:\Desktop> C:\Windows\Microsoft.NET\Framework64\v3.5\csc.exe hello_word.cs

then a executable will be created called hello_word.exe. That is your program. Run that to run you program.

Fixing ethernet network connection

Issue: When plugin in the Ethernet cable to computer would be not have a connection.
Reason: Ethernet driver is not installed, corrupted or out of date.
motherboard: Asus z97-AR
Intel CPU: Intel Core i7-4790K
operating system: Window 7

Fix:
Go to device manager.
Under ‘Other devices’ the Ethernet Controller has a warning icon

donwload then extract ‘Turbo LAN V1.04.01 for Windows 7/8/8.1 32bit & 64bit.’ driver from asus site

In device manager right click on ‘Ethernet Controller’ then ‘Update Driver Software’ then ‘browse my computer for driver software’
Browse to the extracted folder ‘Intel_LAN_Win7-8-8-1_VER191510’ then click next

Restart computer

Mount usb linux command line

# ways to find flash drive
dmesg | tail
sudo fdisk -l
lsusb
ls /dev/sd*
df -h
gnome-disks

# make a directory to mount the usb
sudo mkdir /media/usb

# mount usb
# to grant permission to all when mounting add umask flag. For only root omit flag.
sudo mount -o umask=000 /dev/sda1 /media/usb

# if error mount: unknown filesystem type 'exfat'
sudo apt-get install exfat-fuse exfat-utils

# mount on every boot
# determine the partition/filesystem type for proc column
sudo blkid /dev/sda*

# edit file
sudo nano /etc/fstab

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/sda1       /media/usb      exfat   defaults
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

# unmount
sudo umount /dev/sda1

# resources
How to Mount USB Drive on the Raspberry Pi

# tags
ntfs fat32 ext4

Samba Installation

Installing samba
$ sudo apt-get update
$ sudo apt-get install samba samba-common-bin
$ sudo nano /etc/samba/smb.conf

Configuration example

[global]
	netbios name = PI
	server string = The Pi File Center
	workgroup = WORKGROUP
	hosts allow =
	socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
	remote announce =
	remote browse sync =

[homepi]
	path = /home/pi
	comment = No comment
	browsable = yes
	read only = no
	valid users =
	writable = yes
	guest ok = yes
	public = yes
	create mask = 0777
	directory mask = 0777
	force user = root
	force create mode = 0777
	force directory mode = 0777
	hosts allow =

# password protected
[fsq]
	comment = fsq
	path = /var/fsq
	browseable = Yes
	writeable = Yes
	only guest = no
	create mask = 0777
	directory mask = 0777
	public = no

Creating Samba User:
$ sudo smbpasswd -a pi
type password, press enter

Restart Samba Service:
$ sudo service smbd restart

Resources:

Sync server time and date

sudo service ntp stop
sudo ntpd -gq
sudo service ntp start

sources:
http://askubuntu.com/questions/254826/how-to-force-a-clock-update-using-ntp#answer-256004
https://www.digitalocean.com/community/tutorials/how-to-set-up-timezone-and-ntp-synchronization-on-ubuntu-14-04-quickstart
https://help.ubuntu.com/lts/serverguide/NTP.html