Selasa, 18 Oktober 2016

Error OZEKI

Cannot serve GUI content: Object reference not set to an instance of an object

at OzekiNG.ozUser.g (ozCommon.ozHashtable A_0) <0xb2c0c400 + 0x00601> in :0 at hn.a (OzekiNG.ozUser A_0, ozCommon.ozHashtable A_1) <0xb2c03a80 + 0x01023> in :0 at aa.c (OzekiNG.ozUser A_0, ozCommon.ozHashtable A_1) <0xb2f32f20 + 0x00069> in :0 at a4.b (OzekiNG.ozUser A_0, ozCommon.ozHashtable A_1, System.Text.StringBuilder A_2) <0xb2c2d618 + 0x003a7> in :0 at aa.a (ozSupportedHttp.ozSupportedHttpListenerContext A_0, OzekiNG.ozUser A_1, ozCommon.ozHashtable A_2, System.Text.StringBuilder A_3) <0xb2f4e070 + 0x00076> in :0 at db.a (ozSupportedHttp.ozSupportedHttpListenerContext A_0) <0xb2f49d58 + 0x02457> in :0

SOLUSI :
use UBUNTU 15 .xx





follow this
http://nagios-totals.blogspot.co.id/2016/09/installl-nagios-terbaru.html

 

Nagios Untuk Ubuntu 16.X 32 bit



auto eth0
iface eth0 inet dhcp

## Or configure a static IP
auto eth0
iface eth0 inet static
  address 192.168.1.104
  gateway 192.168.1.1
  netmask 255.255.255.0
  network 192.168.1.1
  broadcast 192.168.1.255


First You need to make sure you have install Ubuntu 16.04 LAMP Server atau http://www.ubuntugeek.com/step-by-step-ubuntu-16-04-xenial-xerus-lamp-server-setup.html

and once you have that follow the next steps. Switch to root user and run the all the commands
sudo su --
Install the following packages
apt-get install build-essential php7.0-gd wget libgd2-xpm-dev libapache2-mod-php7.0 apache2-utils daemon unzip
You need to create nagios user,nagcmd group and add the nagios,apache user to the part of nagcmd group
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data
Download Nagios core DIY Source from here
https://www.nagios.org/downloads/nagios-core/
 
cd /tmp/
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
tar -zxvf /tmp/nagios-4.1.1.tar.gz
cd /tmp/nagios-4.1.1/
Compile and install Nagios Using the following commands
./configure –with-nagios-group=nagios –with-command-group=nagcmd

jika gagal ketik:
sudo ./configure --with-command-group=nagcmd

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
You may get the following error
root@ubuntu:/tmp/nagios-4.1.1# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: cannot create regular file ‘/etc/httpd/conf.d/nagios.conf': No such file or directory
Makefile:296: recipe for target ‘install-webconf' failed
make: *** [install-webconf] Error 1
The above error message is due to that nagios is trying to create the nagios.conf file inside the /etc/httpd.conf/directory. But, in Ubuntu systems the nagios.conf file should be placed in /etc/apache2/sites-enabled/directory
Run the following command instead of make install-webconf
sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/nagios.conf
make install-exfoliation
Configure Nagios web Interface
Create nagiosadmin account using the following command
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Enable CGI module and restart the apache2 server
a2enmod cgi
service apache2 restart
Install Nagios Plugins
Download and install nagios plugins using the following commands
cd /tmp
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
tar -zxvf /tmp/nagios-plugins-2.1.1.tar.gz
cd /tmp/nagios-plugins-2.1.1/
Compile and install nagios plugins using the following commands
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Start Nagios
Verify the sample nagios configuration files using the following command
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Output
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay -- No serious problems were detected during the pre-flight check
If you are not seeing any errors the start nagios using the following
/etc/init.d/nagios start
When i try to start the nagios i got the following error and found out there is an issue with nagios init script
[....] Starting nagios (via systemctl): nagios.serviceFailed to start nagios.service: Unit nagios.service failed to load: No such file or directory. failed!
Solution to nagios init script
Copy /etc/init.d/skeleton to /etc/init.d/nagios using the following command
cp /etc/init.d/skeleton /etc/init.d/nagios
Now edit the nagios file
vi nagios
add the following lines
DESC="Nagios"
NAME=nagios
DAEMON=/usr/local/nagios/bin/$NAME
DAEMON_ARGS="-d /usr/local/nagios/etc/nagios.cfg"
PIDFILE=/usr/local/nagios/var/$NAME.lock
Save and exit the file
Finally you need to change the permissions of the file
chmod +x /etc/init.d/nagios
You can start the nagios using the following command
/etc/init.d/nagios start

Minggu, 16 Oktober 2016

CLI PORT USB

RECOM: SerialConsoleHowto This document presents (almost) the minimum amount of work required to enable a serial console login on an Ubuntu 6.06 and later versions. (Minor changes have been added to improve performance.) Both server and client settings are included. This procedure was developed using the Remote Serial Console HOWTO (see "External links" below), and adapted to apply specifically to Ubuntu. The reader is referred to this document for any issues arising from using this HOWTO. Assumptions You have enabled the serial console in your BIOS.1 The serial connection is being made at 115200 baud 8n1, on first serial port, called /dev/ttyS0 in linux (9600 8n1 is the default fall back if your hardware does not support 115200 baud) You are comfortable editing critical system files such as /etc/inittab, /boot/grub/menu.lst You are using a serial (null modem) cable. It is also possible to use a USB to Serial adaptor, but the tty* must be changed to reflect your hardware. You have an available serial console on ttyS0. If your not getting any output, a real serial port or other device might be using ttyS0. Try using ttyS1, ttyS2, etc. If you want to use a standard Ethernet/RJ-45 cable for serial connection you can buy a couple of Serial to Cat 5 adapters or make one yourself. Server Setup Configuring the console login process This section details how to configure the 'getty' process to enable a login via the console port. You need to configure either an Upstart system or the older inittab, depending on Ubuntu version you are using. Configuring upstart (Karmic and newer) 1) Create a file called /etc/init/ttyS0.conf containing the following: # ttyS0 - getty # # This service maintains a getty on ttyS0 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[12345] stop on runlevel [!12345] respawn exec /sbin/getty -L 115200 ttyS0 vt102 2) Ask upstart to start the getty sudo start ttyS0 Configuring upstart (Edgy/Feisty/Jaunty) Create a file called /etc/event.d/ttyS0 containing the following: # ttyS0 - getty # # This service maintains a getty on ttyS0 from the point the system is # started until it is shut down again. start on runlevel 1 start on runlevel 2 start on runlevel 3 start on runlevel 4 start on runlevel 5 stop on runlevel 0 stop on runlevel 6 respawn exec /sbin/getty 115200 ttyS0 Configuring inittab (only Dapper and older !) 1) Edit /etc/inittab sudo vi /etc/inittab 2) Change the following line: #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 to: T0:123:respawn:/sbin/getty -L ttyS0 115200 vt100 3) Restart init: sudo /sbin/telinit q At this point, a new login prompt should appear on the output of the serial console. Configuring grub This section details how to get grub talking via the serial port. This section is optional if the user does not want grub interaction via the serial console port. Configuring (Karmic and newer) 1) Edit /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. GRUB_DEFAULT=0 GRUB_TIMEOUT=1 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8" # Uncomment to disable graphical terminal (grub-pc only) GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true 2) update grub update-grub Configuring grub (Edgy/Feisty/Jaunty) 1) Edit /boot/grub/menu.lst: vi /boot/grub/menu.lst 2) Add the following lines to the top of the file: # Enable console output via the serial port. unit 0 is /dev/ttyS0, unit 1 is /dev/ttyS1... serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 terminal --timeout=15 serial console 3) When you next reboot, the output from grub will go to the normal console unless input is received from the serial port. Whichever receives input first becomes the default console. This gives you the best of both worlds. Configuring the kernel boot parameters This section details how to configure the kernel boot parameters to get boot information through the console port. This section is optional if the user does not want the kernel boot messages to appear on the serial console port. The following procedure can be carried out by modifying the 'kernel' line in grub prior to committing the changes directly to the /boot/grub/menu.lst file. 1) Edit /boot/grub/menu.lst: sudo vi /boot/grub/menu.lst 2) Modify the kernel line for the image you want to boot using the serial console on. In this case, I'm setting up the default 2.6.10-5.386 kernel to use the serial console line. Change: title Ubuntu, kernel 2.6.10-5-386 root (hd0,0) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro quiet splash initrd /boot/initrd.img-2.6.10-5-386 savedefault boot to: title Ubuntu, kernel 2.6.10-5-386 root (hd0,0) kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro vga=normal console=tty0 console=ttyS0,115200n8 initrd /boot/initrd.img-2.6.10-5-386 savedefault boot Note two "console=" kernel options. You can specify this option several times. All devices, mentioned in it will receive kernel messages (those, generated by printk() and seen by dmesg). However, stdin/stdout/stderr of /sbin/init process will be set to the last device only, therefore only the last device will show startup messages and act as a console in single-user mode. 3) Reboot into this kernel. Output from the boot process should be sent via the serial console line. Client Setup 1) Ensure you have a read/write permissions on /dev/ttyS0. $ ls -l /dev/ttyS0 crw-rw---- 1 root dialout 4, 64 2007-12-20 13:56 /dev/ttyS0 $ id -Gn |grep dialout if the last command didn't show an output add yourself to dialout group and logout/login: sudo adduser $USER dialout Alternatively, you can always run minicom through sudo, but it's not recommended. 2) Install minicom sudo apt-get install minicom 3) Configure minicom. minicom -s 4) Configure client serial port settings: In Serial port setup, set the following options A - Serial device: /dev/ttyS0 E - Bps/Par/Bits: 115200 8N1 4b) Using 7.10 on the server, I needed to set the following on the client: F - Hardware Flow Control : No My 7.10 client and Windows' HyperTerminal both defaulted to Yes; until I changed this client -> server communication did not work. 5) Configure Initialization string: In Modem and dialing clear the init A - Init string ..... 6) Save setup as dfl 7) You might need to press enter several times to get the connection running. 8) To log on in the future, run minicom and press enter several times if it does not come up on start up. Alternative serial client: screen GNU screen actually makes quite a capable serial terminal. To install: sudo apt-get install screen To start: screen /dev/ttyS0 115200 (adjust to requirements) To end the session, use Ctrl-A,Shift-K. REFF http://askubuntu.com/questions/631601/how-to-find-serial-port https://help.ubuntu.com/community/SerialConsoleHowto

CLI Check Port USB Modem


lsusb
dmesg | grep tty




 Sehingga saat menggunakan Ozeki kita bisa dengan mudah mensettingnya...autodetect
 

















OK

apt-get install setserial

setserial -g /dev/ttyS[0123]
Reff :http://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/