rpms/ndoutils/F-11 README.Fedora, NONE, 1.1 ndo-shared-so.patch, NONE, 1.1 ndo2db.cfg, NONE, 1.1 ndo2db.initd, NONE, 1.1 ndomod.cfg, NONE, 1.1 ndoutils.spec, NONE, 1.1 sources, 1.1, 1.2

stevetraylen stevetraylen at fedoraproject.org
Wed Jul 29 16:44:09 UTC 2009


Author: stevetraylen

Update of /cvs/pkgs/rpms/ndoutils/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23498

Modified Files:
	sources 
Added Files:
	README.Fedora ndo-shared-so.patch ndo2db.cfg ndo2db.initd 
	ndomod.cfg ndoutils.spec 
Log Message:
First version


--- NEW FILE README.Fedora ---
Having installed ndoutils you must install ndoutils-mysql. 
Currently this is only database supported by ndoutils more
alternatives will be added later as ndoutils supports them.

The alternatives mechanism is used to choose the version
of ndo2db that you want.

# alternatives --display ndo2db
ndo2db - status is auto.
 link currently points to /usr/sbin/ndo2db.mysql
/usr/sbin/ndo2db.mysql - priority 40
Current `best' version is /usr/sbin/ndo2db.mysql.

To configure ndoutils for use with Nagios and mysql please follow the following
when running with Fedora.

1) Start a shell to MySQL and create and grant access to a database.

mysql> create database nagios
mysql> GRANT ALL ON nagios.* TO ndouser at localhost IDENTIFIED BY "ndopassword";
mysql> quit

2) Load the schema

$ cd /usr/share/doc/ndoutils-mysql-*/db
$ perl ./installdb -u ndouser -p ndopassword -h localhost -d nagios

3) To your /etc/nagios/nagios.cfg file make the following configuration.

broker_module=/usr/lib/nagios/brokers/ndomod.so config_file=/etc/nagios/ndomod.cfg

(lib64 for 64bit of course.)

4) Start ndo2db
/sbin/service ndo2db start
/sbin/chkconfig ndo2db on

4) Restart Nagios
/sbin/service nagios restart





ndo-shared-so.patch:
 Makefile.in |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE ndo-shared-so.patch ---
diff -uNr ndoutils-1.4b7.ORIG/src/Makefile.in ndoutils-1.4b7/src/Makefile.in
--- ndoutils-1.4b7.ORIG/src/Makefile.in	2007-10-03 03:02:58.000000000 +0200
+++ ndoutils-1.4b7/src/Makefile.in	2009-07-20 22:24:31.370396774 +0200
@@ -63,10 +63,10 @@
 	$(MAKE) ndomod-3x.o
 
 ndomod-2x.o: ndomod.c $(COMMON_INC) $(COMMON_OBJS)
-	$(CC) $(MOD_CFLAGS) $(CFLAGS) -D BUILD_NAGIOS_2X -o ndomod-2x.o ndomod.c $(COMMON_OBJS) $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) $(SOCKETLIBS) $(OTHERLIBS)
+	$(CC) $(MOD_CFLAGS) $(CFLAGS) -D BUILD_NAGIOS_2X -o ndomod-2x.so ndomod.c $(COMMON_OBJS) $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) $(SOCKETLIBS) $(OTHERLIBS)
 
 ndomod-3x.o: ndomod.c $(COMMON_INC) $(COMMON_OBJS)
-	$(CC) $(MOD_CFLAGS) $(CFLAGS) -D BUILD_NAGIOS_3X -o ndomod-3x.o ndomod.c $(COMMON_OBJS) $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) $(SOCKETLIBS) $(OTHERLIBS)
+	$(CC) $(MOD_CFLAGS) $(CFLAGS) -D BUILD_NAGIOS_3X -o ndomod-3x.so ndomod.c $(COMMON_OBJS) $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) $(SOCKETLIBS) $(OTHERLIBS)
 
 sockdebug: sockdebug.c $(COMMON_INC) $(COMMON_OBJS)
 	$(CC) $(CFLAGS) -o $@ sockdebug.c $(COMMON_OBJS) $(LDFLAGS) $(LIBS) $(MATHLIBS) $(SOCKETLIBS) $(OTHERLIBS)


--- NEW FILE ndo2db.cfg ---
#####################################################################
# NDO2DB DAEMON CONFIG FILE
#
# Last Modified: 10-29-2007
#####################################################################


# USER/GROUP PRIVILIGES
# These options determine the user/group that the daemon should run as.
# You can specify a number (uid/gid) or a name for either option.

ndo2db_user=nagios
ndo2db_group=nagios



# SOCKET TYPE
# This option determines what type of socket the daemon will create
# an accept connections from.
# Value:
#   unix = Unix domain socket (default)
#   tcp  = TCP socket

socket_type=unix
#socket_type=tcp



# SOCKET NAME
# This option determines the name and path of the UNIX domain 
# socket that the daemon will create and accept connections from.
# This option is only valid if the socket type specified above
# is "unix".

socket_name=/var/run/ndoutils/ndoutils.sock

# TCP PORT
# This option determines what port the daemon will listen for
# connections on.  This option is only vlaid if the socket type
# specified above is "tcp".

tcp_port=5668


# DATABASE SERVER TYPE
# This option determines what type of DB server the daemon should
# connect to.
# Values:
# 	mysql = MySQL
#       pgsql = PostgreSQL

db_servertype=mysql



# DATABASE HOST
# This option specifies what host the DB server is running on.

db_host=localhost



# DATABASE PORT
# This option specifies the port that the DB server is running on.
# Values:
# 	3306 = Default MySQL port
#	5432 = Default PostgreSQL port

db_port=3306



# DATABASE NAME
# This option specifies the name of the database that should be used.

db_name=nagios



# DATABASE TABLE PREFIX
# Determines the prefix (if any) that should be prepended to table names.
# If you modify the table prefix, you'll need to modify the SQL script for
# creating the database!

db_prefix=nagios_



# DATABASE USERNAME/PASSWORD
# This is the username/password that will be used to authenticate to the DB.
# The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on
# the database.

db_user=ndouser
db_pass=ndopassword



## TABLE TRIMMING OPTIONS
# Several database tables containing Nagios event data can become quite large
# over time.  Most admins will want to trim these tables and keep only a
# certain amount of data in them.  The options below are used to specify the
# age (in MINUTES) that data should be allowd to remain in various tables
# before it is deleted.  Using a value of zero (0) for any value means that
# that particular table should NOT be automatically trimmed.

# Keep timed events for 24 hours
max_timedevents_age=1440

# Keep system commands for 1 week
max_systemcommands_age=10080

# Keep service checks for 1 week
max_servicechecks_age=10080

# Keep host checks for 1 week
max_hostchecks_age=10080

# Keep event handlers for 31 days
max_eventhandlers_age=44640





# DEBUG LEVEL
# This option determines how much (if any) debugging information will
# be written to the debug file.  OR values together to log multiple
# types of information.
# Values: -1 = Everything
#          0 = Nothing
#          1 = Process info
#	   2 = SQL queries

debug_level=1



# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed

debug_verbosity=1



# DEBUG FILE
# This option determines where the daemon should write debugging information.

debug_file=/var/log/ndoutils/ndo2db.debug



# MAX DEBUG FILE SIZE
# This option determines the maximum size (in bytes) of the debug file.  If
# the file grows larger than this size, it will be renamed with a .old
# extension.  If a file already exists with a .old extension it will
# automatically be deleted.  This helps ensure your disk space usage doesn't
# get out of control when debugging.

max_debug_file_size=1000000


--- NEW FILE ndo2db.initd ---
#!/bin/bash
#
# ndo2db:		Starts the ndoutils ndo2db utility.
#
# chkconfig: - 30 74
# description:  This is a daemon which creates a socket that in then
#               reads from. The expectation is that Nagios will be writing
#               to this socket using nodutils ndomod brokering utility.
# processname: /usr/sbin/ndo2db
# config: /etc/nagios/ndo2db.cfg
# config: /etc/sysconfig/ndo2db
#
### BEGIN INIT INFO
# Provides: ndo2db
# Required-Start: $syslog
# Required-Stop:
# Default-Stop: 0 1 6
# Short-Description: Starts the ndo2db Daemon
# Description:  This is a daemon which creates a socket that in then
#               reads from. The expectation is that Nagios will be writing
#               to this socket using nodutils ndomod brokering utility.
### END INIT INFO

# Sanity checks.
[ -f /etc/nagios/ndo2db.cfg ] || exit 0
[ -x /usr/sbin/ndo2db ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

NDO2DBUSER=nagios
NDO2DB_OPTIONS="-c /etc/nagios/ndo2db.cfg"
# Source an auxiliary options file if we have one, and pick up NDO2DB_OPTIONS.
[ -r /etc/sysconfig/ndo2db ] && . /etc/sysconfig/ndo2db


RETVAL=0
prog=ndo2db

start () {
    echo -n $"Starting $prog: "
    if [ "$(pidofproc ndo2db)" = "" ]; then
          rm -f /var/run/ndoutils/ndoutils.sock
          daemon --user=$NDO2DBUSER /usr/sbin/ndo2db $NDO2DB_OPTIONS
          RETVAL=$?
    else
          success
          RETVAL=$?
    fi
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ndo2db
    return $RETVAL
}

stop() {
    echo -n $"Stopping $prog: "
    killproc ndo2db
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ndo2db
    return $RETVAL
}

restart() {
    stop
    start
}

# See how we were called.
case "$1" in
    start)
	start
	RETVAL=$?
	;;
    stop)
	stop
	RETVAL=$?
	;;
    status)
	status ndo2db
	RETVAL=$?
	;;
    restart)
	restart
	RETVAL=$?
	;;
    reload)
	status ndo2db && restart || start
	RETVAL=$?
	;;
    condrestart)
	[ -e /var/lock/subsys/ndo2db ] && restart
	RETVAL=$?
	;;
    *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
	RETVAL=1
	;;
esac
exit $RETVAL


--- NEW FILE ndomod.cfg ---
#####################################################################
# NDOMOD CONFIG FILE
#
# Last Modified: 09-05-2007
#####################################################################


# INSTANCE NAME
# This option identifies the "name" associated with this particular
# instance of Nagios and is used to seperate data coming from multiple
# instances.  Defaults to 'default' (without quotes).

instance_name=default



# OUTPUT TYPE
# This option determines what type of output sink the NDO NEB module
# should use for data output.  Valid options include:
#   file       = standard text file
#   tcpsocket  = TCP socket
#   unixsocket = UNIX domain socket (default)

#output_type=file
#output_type=tcpsocket
output_type=unixsocket



# OUTPUT
# This option determines the name and path of the file or UNIX domain 
# socket to which output will be sent if the output type option specified
# above is "file" or "unixsocket", respectively.  If the output type
# option is "tcpsocket", this option is used to specify the IP address
# of fully qualified domain name of the host that the module should
# connect to for sending output.

#output=/usr/local/nagios/var/ndo.dat
#output=127.0.0.1
output=/var/run/ndoutils/ndoutils.sock



# TCP PORT
# This option determines what port the module will connect to in
# order to send output.  This option is only vlaid if the output type
# option specified above is "tcpsocket".

tcp_port=5668



# OUTPUT BUFFER
# This option determines the size of the output buffer, which will help
# prevent data from getting lost if there is a temporary disconnect from
# the data sink.  The number of items specified here is the number of
# lines (each of variable size) of output that will be buffered.

output_buffer_items=5000



# BUFFER FILE
# This option is used to specify a file which will be used to store the
# contents of buffered data which could not be sent to the NDO2DB daemon
# before Nagios shuts down.  Prior to shutting down, the NDO NEB module
# will write all buffered data to this file for later processing.  When
# Nagios (re)starts, the NDO NEB module will read the contents of this
# file and send it to the NDO2DB daemon for processing.

buffer_file=/var/cache/ndoutils/ndomod.buffer



# FILE ROTATION INTERVAL
# This option determines how often (in seconds) the output file is
# rotated by Nagios.  File rotation is handled by Nagios by executing
# the command defined by the file_rotation_command option.  This
# option has no effect if the output_type option is a socket.

file_rotation_interval=14400



# FILE ROTATION COMMAND
# This option specified the command (as defined in Nagios) that is
# used to rotate the output file at the interval specified by the
# file_rotation_interval option.  This option has no effect if the
# output_type option is a socket.
#
# See the file 'misccommands.cfg' for an example command definition
# that you can use to rotate the log file.

#file_rotation_command=rotate_ndo_log



# FILE ROTATION TIMEOUT
# This option specified the maximum number of seconds that the file
# rotation command should be allowed to run before being prematurely
# terminated.

file_rotation_timeout=60



# RECONNECT INTERVAL
# This option determines how often (in seconds) that the NDO NEB
# module will attempt to re-connect to the output file or socket if
# a connection to it is lost.

reconnect_interval=15



# RECONNECT WARNING INTERVAL
# This option determines how often (in seconds) a warning message will
# be logged to the Nagios log file if a connection to the output file
# or socket cannot be re-established.

reconnect_warning_interval=15
#reconnect_warning_interval=900



# DATA PROCESSING OPTION
# This option determines what data the NDO NEB module will process. 
# Do not mess with this option unless you know what you're doing!!!!
# Read the source code (include/ndbxtmod.h) to determine what values
# to use here.  Values from source code should be OR'ed to get the
# value to use here.  A value of -1 will cause all data to be processed.
# Read the source code (include/ndomod.h) and look for "NDOMOD_PROCESS_"
# to determine what values to use here.  Values from source code should
# be OR'ed to get the value to use here.  A value of -1 will cause all
# data to be processed. 

data_processing_options=-1



# CONFIG OUTPUT OPTION
# This option determines what types of configuration data the NDO
# NEB module will dump from Nagios.  Values can be OR'ed together.
# Values: 
# 	  0 = Don't dump any configuration information
#         1 = Dump only original config (from config files)
#         2 = Dump config only after retained information has been restored
#         3 = Dump both original and retained configuration

config_output_options=2



--- NEW FILE ndoutils.spec ---

%global betaversion b8
%{?betaversion: %global dotbetaversion .%{betaversion}}

Name:           ndoutils
Version:        1.4

Release:        0.6%{?dotbetaversion}%{?dist}
Summary:        Stores all configuration and event data from Nagios in a database

Group:          Applications/System
License:        GPLv2
URL:            http://www.nagios.org/download/addons/
Source0:        http://downloads.sourceforge.net/nagios/ndoutils-%{version}%{?betaversion}.tar.gz
Source1:        README.Fedora
Source2:        ndo2db.cfg 
Source3:        ndomod.cfg
Source4:        ndo2db.initd
Patch0:         ndo-shared-so.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  mysql-devel
# On RHEL4 and 5 we build for nagios 2 rather than a default 3 or more.
%if 0%{?el4}%{?el5}
Requires:       nagios < 3
%else
Requires:       nagios >= 3
%endif


Requires(post): chkconfig
Requires(preun): chkconfig, initscripts

%package mysql
Summary: Contains the ndoutils ndo2db for mysql
Group: Applications/System
Requires:ndoutils = %{version}-%{release}

%description mysql
Contains an ndo2db for writing ndoutils data from 
nagios to MySQL.

%description
The NDOUTILS addon is designed to store all configuration and event data 
from Nagios in a database. Storing information from Nagios in a database will 
allow for quicker retrieval and processing of that data and will help
serve as a foundation for the development of a new PHP-based web 
interface in Nagios 3.0.

%prep
%setup -q -n %{name}-%{version}%{?betaversion}
%patch0 -p1

# Remove executable bits from the example scripts in 
# the documentation.
%{__chmod} 644 db/installdb db/prepsql db/upgradedb


%build
%configure 
%{__make} %{?_smp_mflags}
%if 0%{?el4}%{?el5}
%{__cp} src/ndo2db-2x src/ndo2db.mysql
%else
%{__cp} src/ndo2db-3x src/ndo2db.mysql
%endif

%install
# Upstream does not provide an install target.
# http://tracker.nagios.org/view.php?id=21
rm -rf $RPM_BUILD_ROOT

%{__install} -m 644 %{SOURCE1} README.Fedora
%{__install} -m 755 -D src/ndo2db.mysql $RPM_BUILD_ROOT/%{_sbindir}/ndo2db.mysql

%if 0%{?el4}%{?el5}
%{__install} -m 755 -D src/ndomod-2x.so $RPM_BUILD_ROOT/%{_libdir}/nagios/brokers/ndomod.so
%else
%{__install} -m 755 -D src/ndomod-3x.so $RPM_BUILD_ROOT/%{_libdir}/nagios/brokers/ndomod.so
%endif

%{__install} -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/nagios/ndo2db.cfg
%{__install} -m 644 -D %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/nagios/ndomod.cfg
%{__install} -m 755 -D %{SOURCE4} $RPM_BUILD_ROOT/%{_initrddir}/ndo2db
%{__mkdir} -p $RPM_BUILD_ROOT/%{_var}/log/ndoutils
%{__mkdir} -p $RPM_BUILD_ROOT/%{_var}/run/ndoutils
%{__mkdir} -p $RPM_BUILD_ROOT/%{_var}/cache/ndoutils

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)

%{_libdir}/nagios/brokers/ndomod.so
%{_initrddir}/ndo2db

%config(noreplace) %{_sysconfdir}/nagios/ndo2db.cfg
%config(noreplace) %{_sysconfdir}/nagios/ndomod.cfg

%dir %attr(-,nagios,root) /var/run/ndoutils
%dir %attr(-,nagios,root) /var/log/ndoutils
%dir %attr(-,nagios,root) /var/cache/ndoutils

%doc README.Fedora docs README REQUIREMENTS TODO UPGRADING

%files mysql
%defattr(-,root,root,-)
%{_sbindir}/ndo2db.mysql
%doc db

%preun
if [ $1 = 0 ]; then
    /sbin/service ndo2db stop > /dev/null 2>&1 || :
    /sbin/chkconfig --del ndo2db || :
fi

%preun mysql
if [ $1 = 0 ]; then
  /usr/sbin/alternatives --remove ndo2db /usr/sbin/ndo2db.mysql
fi

%post
/sbin/chkconfig --add ndo2db || :

%post mysql
/usr/sbin/alternatives --install /usr/sbin/ndo2db ndo2db /usr/sbin/ndo2db.mysql 40

%changelog
* Tue Jul 21 2009 Steve Traylen <steve.traylen at cern.ch> - 1.4-0.6.b8
- A requires nagios = 2 will not work.

* Tue Jul 21 2009 Steve Traylen <steve.traylen at cern.ch> - 1.4-0.5.b8
- Updated to nodutils 1.4b8.
- mysql lib path no longer needs to be set explicitly.
- Use dist tags to install for nagios2 on el4 and el5.

* Mon Jul 20 2009 Steve Traylen <steve.traylen at cern.ch> - 1.4-0.4.b7
- Patch ndomod.o to be ndomod.so since it is a shared object.
- Move ndomod.so from /usr/lib to /usr/lib/nagios/brokers
- Change URL to better one.
- Change SourceURL to fedora package guideline for sourceforge.
- Completly removed postgres support. The documents clearly state
  it is not supported.

* Sun Jun 14 2009 Steve Traylen <steve at traylen.net> - 1.4-0.3.b7
- Move ndo2db.cfg and ndomod.cfg to /etc/nagios as per install
  guide.
- Remove executable bits from documentation examples.

* Thu Jun 11 2009 Steve Traylen <steve at traylen.net> - 1.4-0.2.b7
- Split package to create postgres and mysql binary in different
  sub packages.

* Wed Jun 10 2009 Steve Traylen <steve at traylen.net> - 1.4-0.1.b7
- Add full URL location to Source0:
- Use special Version/Release tag since a beta. i.e 1.4-0.1.b7

* Sat Apr 25 2009 Steve Traylen <steve at traylen.net> 
- First Build





Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/ndoutils/F-11/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	29 Jul 2009 14:18:41 -0000	1.1
+++ sources	29 Jul 2009 16:44:09 -0000	1.2
@@ -0,0 +1 @@
+767dbfabd94506bc68c59033d7abdaa4  ndoutils-1.4b8.tar.gz




More information about the fedora-extras-commits mailing list