Friday, June 17, 2011

ninja op5 nagios alternative

Ninja

The Ninja project is an attempt to develop an alternative Nagios GUI with the aim of being the most useful Open Source web frontend for Nagios. The project is also included in op5s network monitoring product op5 Monitor.
Brief description of Ninja
  • Create New PHP versions of the existing .cgi's with effort put into removing “obvious problems” such as
    • Lack of good search and filtering. Today's host search can be so much better
    • Scalability. Ways to present large data sets, host lists, service lists, etc
  • Multi language support (gettext)
  • Template/skin support for easy customization of look and feel
  • Support for several databases
  • Session based authentication with support for common auth protocols
    https://wiki.op5.org/
    https://wiki.op5.org/ninja:docs:quickstart-ubuntu

    Ninja - Nagios is Now Just Awesome is a modern web gui for Nagios
       2
       3 Requirements
       4 ------------
       5 Ninja requieres the following softwares to be installed:
       6
       7 php, php-pdo and php-cli 5.1.6+
       8 MySQL 5+ (4 might also work but is not tested)
       9 Nagios 3.0.x+ (needs to run on the same server)
      10 Merlin
      11
      12
      13 Installation
      14 ------------
      15 Ninja is a web application mainly written in php so in short words the
      16 installation goes something like this
      17
      18 1. download, untar and put ninja in some nice place on your server
      19 2. configure your webserver
      20 3. configure ninja with basic info such as where it's installed and where
      21    the database is located.
      22 done :)
      23
      24 Here is a longer and a bit more exact version on how to install it
      25
      26 1. Make sure that all Ninja requirements are installed. In particular Merlin
      27    which is a Nagios module responsible for maintaining a database with Nagios
      28    status, similar to the objects.cache file. For more info about Merlin,
      29    check out http://www.op5.org/
      30
      31 2. download ninja from http://www.op5.org/
      32
      33 3. untar
      34 tar zxvf ninja-x.x.x.tar.gz
      35
      36 4. copy the ninja dir to a suitable location. Will vary between installations.
      37 mkdir /usr/local/nagios/addons/
      38 cp -a ninja /usr/local/nagios/addons/
      39
      40 5. Configure your webserver. We provide an example config file for apache
      41    located at ninja/op5build/ninja.httpd-conf. The example below works for
      42    CentOS and RedHat
      43 vim ninja/op5build/ninja.httpd-conf
      44 cp ninja/op5build/ninja.httpd-conf /etc/httpd/conf.d
      45 service httpd restart
      46
      47 6. Configure Ninja. An example config file exists in ninja/op5build/index.php,
      48    edit the $ninja_base variable and copy it to the ninja root dir. There are
      49    more configuration files located in ninja/application/config/ but you should
      50    normally not require to edit them. Take a look at database.php if you
      51    modified any of the default database settings when installing Merlin.
      52
      53 vim ninja/op5build/index.php
      54
      55   $ninja_base = '/usr/local/nagios/addons/ninja';
      56
      57 cp ninja/op5build/index.php ninja/
      58
      59 7. Setup the db tables required for Ninja by executing
      60
      61 ninja/install_scripts/ninja_db_init.sh
      62
      63    This script will also try to import any existing htpasswd users from your
      64    Nagios config.
      65
      66 8. Point your browser to https://yourip/ninja and try your installation
      67
      68 congratulations! you now (hopfully) have a working Ninja installation
      69
      70 Questions, feedback, patches etc are best sent to op5-users@lists.op5.com
      71 subscription (http://lists.op5.com/mailman/listinfo/op5-users) is needed
      72 to post. Check out www.op5.org for more info about Ninja.
    http://www.op5.org/community/plugin-inventory/op5-projects/ninja


    Merlin

    The Merlin project, or Module for Effortless Redundancy and Loadbalancing In Nagios, for setting up distributed Nagios installations and allowing Nagios processes to exchange information directly.

       1 Requirements
       2 ------------
       3 Merlin requires Nagios 3.2.4 or later.
       4 Since (at the time of this writing), Nagios 3.2.4 is not yet
       5 released, you'll have to use the latest sources from CVS head
       6 or cloned from git, using the following command:
       7
       8    git clone git://git.op5.org/nagios.git
       9
      10
      11 For running merlin with its default configuration, you'll need
      12 to have libdbi-dbd-mysql and all of its dependencies (generally
      13 libdbi-drivers, libdbi and mysql-libs) installed.
      14
      15 You will ofcourse also need an sql database supported by libdbi
      16 (refer to the libdbi documentation for further information about
      17 supported databases), as well as a Nagios installation that the
      18 merlin module can plug in to. The import script is currently
      19 limited to MySQL only, so that's currently the only database
      20 supported.
      21
      22 For the import script to work, you need to have php-cli and
      23 php-mysql installed. They may be named differently in your
      24 distribution, but I'm sure you get the idea.
      25
      26 The install script requires administration privileges to create
      27 its installation directories and copy files there, as well as
      28 sql administration privileges in order to create the database
      29 that merlin will populate for you.
      30
      31 GNU sed 4.0.9 or better is required for the install script to
      32 be able to modify your nagios configuration files.
      33
      34
      35 Compilation
      36 -----------
      37 Merlin doesn't support autoconf (and I'm reluctant to take
      38 patches that makes it do so). You'll need to have libdbi-devel
      39 installed. If it's not in a default location, please amend the
      40 CPPFLAGS manually while running make, like so:
      41
      42      make CPPFLAGS="-I/usr/local/include"
      43
      44
      45 Installation
      46 ------------
      47 There is an install-script provided here which will attempt to
      48 make all the necessary modifications to your nagios.cfg file
      49 as well as installing merlin on your system. Please run
      50
      51   sh install-merlin.sh --dest-dir=/path/to/merlin \
      52            --nagios-cfg=/path/to/nagios.cfg \
      53                    --db-type=mysql --db-user=merlin --db-pass=merlin \
      54                    --db-name=merlin
      55
      56 Note that the install-merlin.sh script requires write access to
      57 whatever directory you choose as --dest-dir, as well as access
      58 to write to your nagios.cfg file.
      59 Also note that the install script can only handle setting up
      60 mysql databases at the moment. Patches welcome to make it also
      61 handle postgresql and whatever else you feel there is a need for.
      62 If a different database type is selected, the install script will
      63 still work, but it will not create the database for you.
      64
      65 Configuration
      66 -------------
      67 Configuring merlin is pretty straight-forward. Check the example.conf
      68 file that accompanies this release and you'll see most of the common
      69 examples available.
      70
      71 The syntax is fairly standard, being made up of a key without
      72 spaces and a value containing arbitrary characters (although no
      73 semi-colons). A configuration statement is terminated either by a
      74 newline or a semi-colon. A configuration statement starting with a
      75 hash-character (#) is considered a comment. Thus,
      76
      77   key = value; # comment
      78
      79 makes "key" the key, "value" the value, terminated by the semi-colon,
      80 and "# comment" all of the comment.
      81 Leading and trailing whitespace is ignored.
      82
      83 The thing it doesn't really cover very well is how to configure masters,
      84 peers and pollers, which is described more in-depth here.
      85
      86 In order to set up a loadbalanced system (ie, 2 or more peers), all
      87 you need to do is add a section similar to the following to your
      88 merlin configuration files on your merlin-empowered Nagios systems.
      89 Let's pretend we have "nagios1" and "nagios2" in the network and
      90 you wish for them to be set up in loadbalanced/redundancy mode.
      91 nagios1 has 192.168.1.1 as IP. nagios2 has 192.168.1.2. Both use
      92 port 15551 (the default).
      93
      94 On nagios1, add the following section to your merlin.conf file:
      95   --------------
      96   peer nagios2 {
      97     address = 192.168.1.2;
      98     port = 15551; # optional, since 15551 is the default
      99   }
     100   --------------
     101
     102 On nagios2, add the following section to your merlin.conf file:
     103   --------------
     104   peer nagios1 {
     105     address = 192.168.1.1;
     106     port = 15551; # optional, since 15551 is the default
     107   }
     108   --------------
     109
     110 Assuming nagios2 is a poller-node instead, responsible for checking
     111 hosts in germany, you need to create a hostgroup in Nagios containing
     112 all the hosts in germany that you want nagios2 to check for you. Let's
     113 assume you call that hostgroup "germany-hosts". Then you need to add
     114 following sections to your merlin.conf files.
     115
     116 On nagios1 (the "master" server), add the following section:
     117   --------------
     118   poller nagios2 {
     119     address = 192.168.1.2;
     120         port = 15551;
     121         hostgroup = germany-hosts; # name of the hostgroup containing all
     122                                    # the hosts you want this poller to check
     123   }
     124   --------------
     125
     126 On nagios2 (the slave server), add the following section:
     127   --------------
     128   master nagios1 {
     129     address = 192.168.1.1;
     130         port = 15551;
     131   }
     132   --------------
     133
     134 Note that these configuration sections need to be in the base section
     135 of the configuration file. They must *not* be inside the daemon section.
     136 This is because the master server will disable checks for all its pollers
     137 once those pollers connect, and therefore it needs to read the list of
     138 available nodes at configuration time.
     139
     140 A merlin node can have up to 65534 neighbours (assuming your system
     141 lets a single program have that many file-descriptors open). A neighbour
     142 is, in merlin terminology, a node that merlin connects to directly, so
     143 you can build arbitrarily large networks by just specifying multiple
     144 tiers of pollers.
     145
     146 A single merlin node can have pollers, peers and master nodes in its own
     147 neighbourhood. As such, a single merlin node can, at the same time be
     148 a peer (to its peers), a master (to its pollers) and a poller (to its
     149 masters). One section has to be added to the merlin.conf file for each
     150 of the hosts in its neighbourhood. The section must contain the
     151 address of the neighbour, the port the neighbour is listening to
     152 (unless it's the default port 15551) and, if the neighbour is a poller,
     153 the section *must* contain a hostgroup statement declaring which
     154 hostgroup the poller is responsible for checking.



    Download and extract the code

    Get the latest version of Ninja (ninja-1.0.1.tar.gz in my case) from the project page.
    Extract the tar file and move Ninja to a folder of choice:
    tar -zxvf ninja-1.0.1.tar.gz
    
    # become root (or type sudo before all the following commands)
    sudo -s
    cp -a ninja-1.0.1 /usr/local/nagios/addons/ninja
    cd /usr/local/nagios/addons/ninja
    

    Configure Apache

    Copy the example config file to your Apache configuration:
    cp op5build/ninja.httpd-conf /etc/apache2/conf.d/ninja.conf
    
    And edit /etc/apache2/conf.d/ninja.conf to have the correct path for Ninja:
    
            LoadModule alias_module modules/mod_alias.so
    
    
    Alias /ninja /usr/local/nagios/addons/ninja
    
            Order allow,deny
            Allow from all
            DirectoryIndex index.php
    
    
    Restart Apache:
    /etc/init.d/apache2 restart
    

    Modify and run the install scripts

    Edit install_scripts/auth_import_mysql.php to have the correct paths for Merlin and Nagios configuration files:
    ...
    private $merlin_path = '/usr/local/nagios/addons/merlin';       # where to find merlin files
    private $nagios_cfg_path = '/usr/local/nagios/etc';             # path to nagios cfg files
    ...
    
    You will also need to modify install_scripts/auth_import_mysql.php to use the correct path to awk using this line:
    sed -i 's/\/bin\/awk/\/usr\/bin\/awk/g' install_scripts/auth_import_mysql.php
    
    Run the installation script:
    install_scripts/ninja_db_init.sh /usr/local/nagios/addons/ninja
    

    Install dependencies

    apt-get install libmysqld-dev
    apt-get install php5-gd
    /etc/init.d/apache2 restart
    
    Stop nagios:
    /etc/init.d/nagios stop
    

    Edit setup script

    Edit setup.sh and modify it as follows:
    vi scripts/setup.sh
     mod_path=/usr/local/nagios/addons/reports-module
     prefix=/usr/local/nagios
    
     # Remove the following lines (or use comments, i.e #):
     php $mod_path/find_configured.php \
         > /tmp/$name.interesting
    
     archived="$prefix/var/archives/nagios-*.log"
     nagioslog=$prefix/var/nagios.log
    
     # remove the line
     /etc/rc.d/init.d/monitor start
    
    Run the script to create the database and tables:
    sh scripts/setup.sh
    
    # if no errors were encountered, run
    make
    
    /etc/init.d/nagios start
    

    Import ninja report table definitions

    To be able to save and schedule your availability and SLA reports, Ninja needs some additional tables:
    mysql monitor_reports < /usr/local/nagios/addons/ninja/install_scripts/reports.sql
    

    Set nagios_base_path

    Finally we need to set the nagios_base_path variable in /application/config/config.php
    $config['nagios_base_path']='/usr/local/nagios';
    


installing nagios mysql plugin

http://nagiosplugins.org/man/check_mysql

check_mysql_health is a plugin for Nagios that allows you to monitor a MySQL database. Among the list of metrics are time to login, index usage, bufferpool hit rate, query cache hit rate, slow queries, temp tables on disk, table cache hit rate, connected threads, and many more. Requirements are either a DBD::mysql Perl module or a MySQL client package.
http://exchange.nagios.org/directory/Plugins/Databases/MySQL/check_mysql_health/details
http://labs.consol.de/nagios/check_mysql_health/

You can check for the latest plugin at:
  http://www.consol.com/opensource/nagios/check-mysql-health

The documentation in this README covers only the most common features.
To view the full documentation and examples, go to
  http://www.consol.com/opensource/nagios/check-mysql-health or
  http://www.consol.de/opensource/nagios/check-mysql-health

 cd check_mysql_health-2.1.5.1


 ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a pax tar archive... gnutar
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
variable with_statefiles_dir is /var/tmp/check_mysql_health
variable with_mymodules_dir is /usr/local/nagios/libexec
variable with_mymodules_dyn_dir is /usr/local/nagios/libexec
checking for sh... /bin/sh
checking for perl... /usr/bin/perl
checking for gzip... /bin/gzip
checking for gawk... no
checking for nawk... /usr/bin/nawk
checking for grep... /bin/grep
checking for echo... /bin/echo
checking for sed... /bin/sed
checking for cat... /bin/cat
configure: creating ./config.status
config.status: creating Makefile
config.status: creating plugins-scripts/Makefile
config.status: creating plugins-scripts/subst
config.status: creating t/Makefile
                       --with-perl: /usr/bin/perl
             --with-statefiles-dir: /var/tmp/check_mysql_health
                --with-nagios-user: nagios
               --with-nagios-group: nagios
              --with-mymodules-dir: /usr/local/nagios/libexec
          --with-mymodules-dyn-dir: /usr/local/nagios/libexec

installing apache and mysql on ubuntu via the command line

open your terminal window and type

Install Apache

    The following mod-security, ldap, and odbc libraries are optional:

sudo apt-get install apache2 libapache2-mod-php5 php5-gd
sudo apt-get install libapache2-mod-security php5-ldap php5-odbc

    Restart Apache

sudo /etc/init.d/apache2 restart


Install other software

sudo apt-get install openssh-server unattended-upgrades
sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
sudo apt-get install curl php5-curl php5-xmlrpc
sudo apt-get install clamav-base clamav-freshclam clamav


Install MySQL
sudo apt-get install mysql-server php5-mysql

sudo apt-get dselect-upgrade
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages will be upgraded:
  foo2zjs
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,584 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main foo2zjs i386 20110210dfsg-1ubuntu2.1 [1,584 kB]
Fetched 1,584 kB in 14s (113 kB/s)                                            
(Reading database ... 137965 files and directories currently installed.)
Preparing to replace foo2zjs 20110210dfsg-1ubuntu2 (using .../foo2zjs_20110210dfsg-1ubuntu2.1_i386.deb) ...
Unpacking replacement foo2zjs ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 1 changed doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for python-support ...
Setting up foo2zjs (20110210dfsg-1ubuntu2.1) ...


sudo apt-get install apache2 libapache2-mod-php5 php5-gd
Reading package lists... Done
Building dependency tree      
Reading state information... Done
apache2 is already the newest version.
libapache2-mod-php5 is already the newest version.
php5-gd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo apt-get install libapache2-mod-security php5-ldap php5-odbc
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package libapache2-mod-security

sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

sudo apt-get install openssh-server unattended-upgrades
Reading package lists... Done
Building dependency tree      
Reading state information... Done
unattended-upgrades is already the newest version.
Suggested packages:
  rssh molly-guard openssh-blacklist openssh-blacklist-extra
The following NEW packages will be installed:
  openssh-server ssh-import-id
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 317 kB of archives.
After this operation, 913 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main openssh-server i386 1:5.8p1-1ubuntu3 [311 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ natty/main ssh-import-id all 2.4-0ubuntu1 [5,934 B]
Fetched 317 kB in 2s (107 kB/s)    
Preconfiguring packages ...
Selecting previously deselected package openssh-server.
(Reading database ... 137965 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.8p1-1ubuntu3_i386.deb) ...
Selecting previously deselected package ssh-import-id.
Unpacking ssh-import-id (from .../ssh-import-id_2.4-0ubuntu1_all.deb) ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.8p1-1ubuntu3) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
ssh start/running, process 9916
Setting up ssh-import-id (2.4-0ubuntu1) ...

sudo apt-get install unzip zip aspell-en aspell-fr aspell-de aspell-es
Reading package lists... Done
Building dependency tree      
Reading state information... Done
aspell-en is already the newest version.
unzip is already the newest version.
zip is already the newest version.
The following NEW packages will be installed:
  aspell-de aspell-es aspell-fr
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 889 kB of archives.
After this operation, 1,614 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/universe aspell-de all 20091006-4.2ubuntu1 [323 kB]

sudo apt-get install curl php5-curl php5-xmlrpc
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libcurl3
The following NEW packages will be installed:
  curl libcurl3 php5-curl php5-xmlrpc
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 455 kB of archives.
After this operation, 1,180 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main libcurl3 i386 7.21.3-1ubuntu1 [220 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ natty/main curl i386 7.21.3-1ubuntu1 [179 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main php5-curl i386 5.3.5-1ubuntu7.2 [25.2 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main php5-xmlrpc i386 5.3.5-1ubuntu7.2 [31.4 kB]
Fetched 455 kB in 5s (88.5 kB/s)      
Selecting previously deselected package libcurl3.
(Reading database ... 138099 files and directories currently installed.)
Unpacking libcurl3 (from .../libcurl3_7.21.3-1ubuntu1_i386.deb) ...
Selecting previously deselected package curl.
Unpacking curl (from .../curl_7.21.3-1ubuntu1_i386.deb) ...
Selecting previously deselected package php5-curl.
Unpacking php5-curl (from .../php5-curl_5.3.5-1ubuntu7.2_i386.deb) ...
Selecting previously deselected package php5-xmlrpc.
Unpacking php5-xmlrpc (from .../php5-xmlrpc_5.3.5-1ubuntu7.2_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for libapache2-mod-php5 ...
 * Reloading web server config apache2                                          apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                         [ OK ]
Setting up libcurl3 (7.21.3-1ubuntu1) ...
Setting up curl (7.21.3-1ubuntu1) ...
Setting up php5-curl (5.3.5-1ubuntu7.2) ...
Setting up php5-xmlrpc (5.3.5-1ubuntu7.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

 sudo apt-get install clamav-base clamav-freshclam clamav
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  libclamav6 libtommath0
Suggested packages:
  clamav-docs libclamunrar6
The following NEW packages will be installed:
  clamav clamav-base clamav-freshclam libclamav6 libtommath0
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,275 kB of archives.
After this operation, 12.0 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

sudo apt-get install mysql-server php5-mysql
Reading package lists... Done
Building dependency tree      
Reading state information... Done
mysql-server is already the newest version.
php5-mysql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Tuesday, June 14, 2011

Important Mods for SMF Forums

1.    Share This Topic     2.8.2     
2.    httpBL     2.5.1     
3.    Stop Forum Spam     0.9     
4.    Stop Spammer     2.3.9     
5.    Google +1 Topics     1.0     
6.    NoFollow All Links     1.2.1     
7.    EzPortal

SMF Forums Facebook plugin - SA Facebook 2.0 RC Rev21

Warning: You must create an application on facebook to use this modification
For information on creating your application

Change Log:
14 June, 2011 [2.0 Initial Release]
- Register with facebook (new members)
- Integrate forum account with facebook (existing members)
- Disassociate forum account from facebook
- Update your Status on facebook
- Import your facebook avatar
- Invite your facebook friends
- Like/Recommend your site to friends on facebook
- Share, Like, and Publish topics to your facebook wall
- Facebook Comment Box
- Facebook Fan Page
- Friends... View all your facebook friends
            Left blank intentionally:
SMF Features
- ACP - this mod has its own admin control panel for easy use
- Supports Standard and Advanced Profile Fields [SMF 2.0 only]
- Facebook admin logs (see all register/Integrated fb users)
- Membergroup (default membergroup for new facebook registered members)
- Buddy list integration (users can sync their forum and fb friends)

 affter installing goto facebook admin and unsync all current facebook users this is reqired for the mod to function properly

To unsubscribe from these announcements, login to the forum and uncheck "Receive forum announcements and important notifications by email." in your profile.

You can view the full announcement by following this link:
http://www.sa-mods.info/index.php?topic=1253.0