How to De-Bone Quail

My quick video guide to de-boning quail… It’s a bit of a fiddly process, but the end result is worth it – these suckers have a lot to give!

http://youtu.be/L7yKmE_s6CE

 

VN:F [1.9.16_1159]
Rating: 1.0/10 (1 vote cast)
VN:F [1.9.16_1159]
Rating: -1 (from 1 vote)

Remove Data ‘Spikes’ from RRDs

How to Remove Data ‘Spikes’ from RRDs

If you are recording data into RRDs (for use with, e.g. Nagios, Nagiosgraph etc.) Sometimes you will notice that unreasonable data anomalies creep into the dataset due to the way that data is recorded during a non-standard event (e.g. the restart of a server etc.)

In my case, I found a situation where the Input and Output bandwidth of a Server NIC was incorrectly defined at -600Mb/s when there was a server restart — this is obviously an incorrect value, and I needed to clean this detail from my RRD in order to obtain a more realistic graph for the entire period.

The Anamalous data in the RRD file distorts the data for the graph of NIC bandwith usage

There are one or two tools available for use in this case:

RemoveSpikes.pl – is an application written specifically for this purpose in mind, and apparently works OK. But I found that this script did not resolve my issue

RRD Editor – is a free cross-platform GUI application which is also designed for this purpose, but I found I had problems running this application (and did not persevere)

rrdtune - is a tool which is bundled with the ‘rrdtools’ toolset. I found that this application was able to normalise the results in my dataset and perform the task admirably

How to use rrdtune to eradicate spikes in RRD data:

The author’s instructions for using rrdtune are found here: http://oss.oetiker.ch/rrdtool/doc/rrdtune.en.html

I also found the following instructions on using rrdtune on the following (helpful) blog: http://kudithipudi.org/2004/03/18/rrdtool-how-to-remove-spikes/

cp filename.rrd filename.rrd.backup
Any good admin knows that before you mess with a file, you make a backup  .

rrdtool info filename.rrd | more
This gives us the chance to get the ds (data sources) names

rrdtool tune filename.rrd –maximum (OR –minimum) ds_name:MAX/MIN_VALUE
Set the maximum of the ds to the required

rrdtool dump filename.rrd > filename.xml
Export all data in the rrd to a xml file

mv filename.rrd filename.rrd.old
Rename the rrd to make way for the new one.

rrdtool restore filename.xml filename.rrd -r
Restore the rrd from the xml file with the -r (range check) option. So any values that are higher than the new maximum value are ignored.

So the process is basically to:

  • Backup the original .RRD file which is to be manipulated
  • Apply a MIN or MAX threshold for the target ‘ds_name’ metric
  • Write the target .RRD to an .XML file
  • Rename the original .RRD file
  • then import the .XML file into a new .RRD file (which is the same name as the original file)

The problem I experienced, was that I did not know what the correct ‘ds_name’ referred to… However, a little experimentation with the commands perfected the process for me.

The location of my ‘Nagiosgraph’ RRDs was: /var/spool/nagiosgraph/rrd/

The commands which I ran to successfuly change the MIN level for my RRD file are as follows:

  • sudo rrdtool info <filename> | more

How to find the 'ds_name' - note the 'data' metric highlighted in screenshot above

Using the above mentioned command – it is possible to show the metrics which are available in the RRD file. See the screenshot above, where the ‘data’ metric refers to the ‘ds_name’ which I needed to use – currently it is not set to any specific threshold

  • sudo rrdtool tune <filename> –minimum data:-500

This command successfully adjusted the minimum threshold for the ‘data’ metric to -500

Repeating the previous 'rrdtool info' command shows that adjustment of the minimum threshold for 'data' has been set to -500

  • rrdtool dump filename.rrd > filename.xml
  • mv filename.rrd filename.rrd.old
  • rrdtool restore filename.xml filename.rrd -r

This series of commands successfully eliminated the anomalous entry in the RRD file

Anomalous Data removed from RRD file and Resultant Graph is Good


VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)

Migrate MSSQL Database from Simple to Full Recovery Model

How to Migrate MSSQL Database from Simple to Full Recovery Model

This blog posting is a follow up to my previous blog post (http://www.parksharp.net/?p=359) ‘Create MSSQL Maintenance Tasks’ and build upon the previous example by addressing the creation and management of Database Transaction Logs for the purpose of providing a more robust recovery option than is available with the so-called ‘Simple’ Recovery option.

The object of this post is to describe the process of migrating an MSSQL Database from the ‘SIMPLE’ Recovery Model (which has limited recovery potential) to the ‘FULL’ Recovery Model

There are three Recovery Models supported by the MSSQL Database Server:

Simple Recovery Model – Allows the database to be recovered to the most recent backup.

Full Recovery Model – Allows the database to be recovered to the point of failure.

Bulk Logged Recovery Model -Allows bulk-logged operations (can recover to the end of any backup)

Note: The differences between these recovery models is further and fully explained on the Microsoft MSDN website

Essentially, the Simple Recovery Model (which is the default configuration for SQL Server Personal Edition and SQL Server Desktop Engine (MSDE) products) minimises administrative overhead for the transaction log because the transaction log is not backed up. The Full recovery and Bulk Logged recovery models rely on a backed up transction log, and therefore provide greater protection for the data. The Full recovery model also supports restoration of individual data pages

The information provided on Microsoft’s MSDN website advises that a ‘database can be switched to another recovery model at any time’ and from my practical experience in executing a switch from Simple to Full Recovery model, I did not encounter any abnormal Database behaviour, and was not requested to Restart the Database and/or Server (which was helpful)

To view or change the Recovery Model of a Database (using MSSQL Server Management Studio)

  • After connecting to the appropriate instance of the Microsoft SQL Server Database (using MSSQL Server Management Studio), click on the server name to expand the server tree
  • Expand Databases, and depending on the database, either select  a user database or expand ‘System Databases’ and select a database
  • In the ‘Select a Page’ pane, click ‘Options’
  • The Recovery Model in use by the database is displayed in the ‘Recovery Model’ list box
  • You can change to Full, Bulk-Logged, or Simple model from the displayed list

Change the Recovery Model from Simple to Full

  • As stated above, we can change the database from Simple to Full… in the ‘Select a Page’ window, choose ‘Transaction Log Shipping’ option – If the Database is currently running a Simple Recovery Model, you will see the following dialogue
Transction Log Shipping Dialogue

Transction Log Shipping Dialogue

  • From the ‘Options’ dialogue, choose the Recovery Model ‘Full’ – then click ‘OK’
Change to Full Recovery Model

Change to Full Recovery Model

  • Immediately after this change, it is important to manually execute a FULL Database backup (in order to start the log chain). The switch to the Full or Bulk Logged recovery model takes effect only after the first database backup
  • It is now important to schedule regular log backups in order to provide a robust data recovery plan

Create a Maintenance Plan to Backup the Database Transction Log:

Follow the instructions from my previous blog posting (http://www.parksharp.net/?p=359) to create a Database Transaction Log Backup Maintenance Plan

  • Use the built-in SQL Server Management Studio ‘Maintenance Plan Wizard’ to Create a Backup Job
Use the Maintenane Plan Wizard to create a Maintenance Job

Use the Maintenane Plan Wizard to create a Maintenance Job

  • Choose the frequency of the Transaction Log backup, and other options
Choose Frequency and Options

Choose Frequency and Options

  • Choose the listed option to ‘Backup Database (Transction Log)’
Choose 'Backup Database (Transaction Log)' option

Choose 'Backup Database (Transaction Log)' option

  • Choose the order for execution of the task(s) – then click ‘NEXT’
Task Execution Order

Task Execution Order

  • Choose the Target Database
Choose Target Database

Choose Target Database

Choose Target Database (2)

Choose Target Database (2)

  • Write a Maintenance Job Report and optionally email to recipient
Write a Report and/or Email

Write a Report and/or Email

  • Review Details before finishing Maintenance Plan Wizard
Review Details

Review Details

  • Close Maintenance Plan Wizard
Close Maintenance Plan Wizard

Close Maintenance Plan Wizard

 

Manually Execute ‘Backup Database Transction Log’ Maintenance Job:

To ensure that the job is working, manually execute the job (by right-clicking on the item in ‘SQL Management Studio > Management > Maintenance Plans’ and choosing ‘Execute’

  • After the Maintenance Task has run, you should expect to see a ‘Success’ notification in the window whcih appears
Successful Execution of Maintenance Task

Successful Execution of Maintenance Task

  • The first Transaction Log is written to the nominated Backup Directory
First Backup Transaction Log is Written

First Backup Transaction Log is Written

And Every 15 minutes, another Transaction Log is generated – the automated backup job is working as expected

The Automated Task is being performed every 15 mins

The Automated Task is being performed every 15 mins

 

Modify the Maintenance Job – Delete .TRN files if the ‘Backup Transaction Logs’ job fails

So now  that the automated backup of transaction logs is in place, it is important to consider what happens if the Transaction Logs Backup job fails. In this case we want to delete the .TRN files which are older than one hour (in order to limit any issues which may be causing the problem)

  • We create a ‘Maintenance Cleanup’ sub-task for the original backup job (from the ‘Toolbox’ in SQL Management Studio) – and choose the options shown below
Choose Options for sub-task

Choose Options for sub-task

  • but we change the ‘Constraint’ of the sub-task to only execute if the original job fails
Change sub-task constraint to execute if Main Task fails

Change sub-task constraint to execute if Main Task fails

  • Then create a Second sub-task to run a T-SQL Statement (to dump transaction for this database with No_Log) if the backup of the Transaction Logs fails
Second Sub-Task: T-SQL Statement to dump transaction with No_Log

Second Sub-Task: T-SQL Statement to dump transaction with No_Log

  • So  the entire Maintenance Task now looks like this (Red lines indicate execution of sub-tasks upon failure of parent task):
View the visual representation of the Maintenance Task in SQL Management Studio

View the visual representation of the Maintenance Task in SQL Management Studio

 

Delete Transaction Logs after 3 days

We can delete the transaction logs after a reasonable period of time – In this example I am assuming that I will not have to roll-back database data using transaction logs for more than 3 days.

In my previous blog post (http://www.parksharp.net/?p=359) I described the configuration of another Daily Maintenance Task which generated a FULL Database Backup of all System Databases. The next step in the management of Transction Logs is to modify this Maintenance task to include another sub-task which deletes all Transaction Logs which are older than 3 days

  • Follow the procedure described above to create another sub-task of the ‘Daily Full Database Backup’ Maintenance job
  • Configure the sub-task options to Delete all ‘Backup Files’ (.trn file extension) which are located in the Transction Logs directory which is specified in the ‘Transaction Logs Backup’ Maintenance job (above)
Delete Transaction Log (.trn) files after 3 days

Delete Transaction Log (.trn) files after 3 days

  • Now the original ‘Daily Full Database Backup’ Maintenance Task should look like this (the clean-up of transaction logs sub-task is shown in red outline)
Full Daily Backup Maintenance Task with Additional 'Cleanup Translog' Sub-Task

Full Daily Backup Maintenance Task with Additional 'Cleanup Translog' Sub-Task

 

VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)

Create MSSQL Maintenance Tasks

Create Database Maintenance Tasks with Microsoft SQL Server Management Studio

The object of this blog post is to describe the process for correctly implementing Maintenance Tasks in MSSQL Server 2005

Firstly we should determine what type of Maintenance Tasks should be performed – In my case, I needed the following:

  • Backup Database and Delete Old Backup Files – Occurs Every Day at 01:00am
  • Backup Transaction Log – Occurs every 15mins (between 01:30am and 23:30pm – i.e. when other demanding maintenance tasks are not being performed)
  • Check DB Integrity and Update Statistics – Occurs once each day at 23:30pm
  • Delete DB History – Occurs every day at 06:00am
  • Reorganisation of DB – Occurs every day at 02:45am

We then need to create a file structure on the server (ideally an independent ‘Backup’ storage location) which will accommodate the backups.

NOTE:For Virtual Machine Servers it is advised that independent system partitions are used for OS, Database Files and Backups to assist with performance

Create a Directory Structure for DB Backups

Create a Directory Structure for DB Backups

 

Configure the first Scheduled Maintenance Task – ‘Backup ALL Databases’

As an example, in this exercise we will configure the first maintenance task which is to Backup All System Databases (as the primary Maintenance Task) and to Delete Old Database Backups (as secondary sub-tasks of the Maintenance Job)

  • Ensure SQL Server Agent is running and set to Automatically Start
  • Open MSSQL Management Studio
  • Login as SA
  • Choose Management > Maintenance Plans > Wizard
Maintenance Plans > Wizard

Maintenance Plans > Wizard

  • Create an appropriate Plan
Create a Plan

Start to create a plan

  • Provide an appropriate Plan Name
Change Schedule Details

Name the Task Appropriately

  • - then choose the ‘Change’ button to configure the job to start daily and on scheduled time 01:00am – then click on ‘NEXT’
Change Schedule Details

Change Schedule Details

  • Click ‘OK’ then ‘NEXT’ – now choose from the list of pre-defined Database ‘Maintenance Tasks’ the option Back Up Database Full – then click on ‘NEXT’
Choose the type of Mainteance Task

Choose the type of Maintenance Task(s) to be performed

  • Choose the Order of Execution for the Task(s) identified in the previous step – then click ‘NEXT’
Define 'execution order' for tasks

Define 'execution order' for tasks

  • Now choose databases to backup… (choose ALL Databases) – and, by using the built-in directory chooser, browse to and select to backup to a top-level directory (and automatically generated sub-directory for each separate) database. Also choose the file extension to be used for DB backups (i.e. .bak). Then click on ‘OK’
Define Databases, Directories and Backup File Extension

Define Databases, Directories and Backup File Extension

  • Write a report to the same location – (optionally define an email address for sending). Then click ‘NEXT’
Write a Report for the Task Execution

Write a Report for the Task Execution

  • Review the details of the Task in the final page of the Wizard – then click ‘FINISH’ to create the task
Finish Creation of Maintenance Task

Finish Creation of Maintenance Task

  • Click on ‘CLOSE’
Close the Wizard

Close the Wizard

  • The task is now visible in ‘MSSQL Management Studio’ under ‘Management > Maintenance Plans’
View Maintenance Tasks in Management Studio

View Maintenance Tasks in Management Studio

 

Manually Executing the Maintenance Task

  • You can Modify a Maintenance task by Right-Clicking on the Task, and selecting ‘Modify’ – but right, now, we will choose the option ‘EXECUTE’ to run the daily backup manually for the first time (which will hopefully create the subdirectories for each DB)
  • Right-Click on the Maintenance Task and choose ‘EXECUTE’
Manually Execute Maintenance Task

Manually Execute Maintenance Task

  • A window will open and advise regarding execution status
Task Execution Status

Task Execution Status

  • After the job is complete (allow several minutes for large databases) you should see that that Maintenance Task has created sub-folders for each system database, in the directory which you determined – and database ‘.bak’ files are now being saved therein

 

Modify the Maintenance Task – Delete Old Database Backups (as sub-tasks)

Now that the directory structure for the ‘Daily’ backups is created – we should MODIFY the same job to add the ‘Cleanup/Maintenance Tasks’ (which will delete .bak files from each sub-directory after 7 days)

  • For this job, create a “Maintenance Cleanup Task” for each Database (see highlighted option in the ‘Toolbox’ shown below)
Add a Maintenance Cleanup (sub)Task to the DB Backup Task

Add a Maintenance Cleanup (sub)Task to the DB Backup Task

  • Locate the Database file location – then choose to delete backup (.bak) files after e.g 7 days (as shown below):
Delete Old DB Backup files in Specific Directory

Delete Old DB Backup files in Specific Directory

  • Repeat for all System Databases which are being backed up – the resultant task should look like the example below. The green lines which originate from the original ‘Full Backup’ task show that the sub-tasks are dependent on the successful completion of the ‘Full Backup’ task
Visual Representation of Parent Maintenance Task with Sub-Tasks

Visual Representation of Parent Maintenance Task with Sub-Tasks

Remaining Tasks:

Repeat the above process for all your required Database Maintenance tasks – pay particular attention to the timing of independent maintenance tasks to ensure there are no conflicts (i.e. Your monthly Database Backup Task should not conflict with a Daily or Weekly Database Backup Task)

 

VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)

Install dd-wrt on Asus RT-N16 wireless router

I was hoping to extend the wireless range of my home network so that I could stream HDTV (from MythTV box) to the furthest extremities of my property. After reviewing a number of internet forums, I realised that an appropriate (and relatively cheap – when considering the many features) device to achieve this in my network (without requiring installation of additional cabling) was the Asus RT-N16 wireless router (a cheaper Asus RT-N12 router was also a good possibility for this use)

I also decided to choose either of the Asus RT-N devices because of the ability to upgrade the default firmware in the device with the free-ware (and open-source) dd-wrt firmware, which provides a number of amazing features – and in my case, provided ‘Repeater-Bridge Mode’

The Website http://www.dd-wrt.com/site/support/router-database advertises that the RT-N16 wireless router is supported for installation of dd-wrt firmware

RT-N16 Wireless Router supported by (3rd party) dd-wrt firmware

RT-N16 Wireless Router supported by (3rd party) dd-wrt firmware

Instructions for installing this firmware are also provided by a wiki link on the dd-wrt site (mentioned above) http://www.dd-wrt.com/wiki/index.php/Asus_RT-N16, However, the dd-wrt wiki instructions indicated the installation/use of a later firmware option than shown in the screenshot above… I decided to follow the wiki instructions, and download the files:

  • ‘dd-wrt.v24-15778_NEWD-2_K2.6_mini_RT-N16.trx’ [this was used for initial firmware upgrade - apparently a necesary step when transitioning from original Asus firmware]
  • ‘dd-wrt.v24-15778_NEWD-2_K2.6_big.bin’ [this was used for the final/operational firmware upgrade]

In following the instructions provided on the dd-wrt wiki, I performed the following changes:

  1. Disabled my wireless access on my PC, and connected to the RT-N16 on LAN port 1 (via ethernet cable)
  2. The first thing I noticed (when the configuration page appeared in ‘Internet Explorer’ (yes – this is the recommended browser to use!) is that it automatically directed me to an ‘Installation Wizard’ page, and advised that I should connect the WAN port to a WAN source… I promptly changed the URL in my browser to view 192.168.1.1 (default management address) where I was able to enter the username and password (admin/admin) and access the device Control Panel using the default Asus firmware
  3. Go to: ‘Advanced Settings’ > ‘Administration’ section there is a link for ‘Firmware Upgrade’ – use this to point to the (mini) downloaded dd-wrt firmware file, (‘dd-wrt.v24-15778_NEWD-2_K2.6_mini_RT-N16.trx’) then hit the upgrade button
  4. A progress bar is shown, and after approx. 3 minutes the firmware is loaded, and the browser automatically opens to the dd-wrt login screen
  5. Enter root as the user and anything for the password as you will do the user/pass procedure again after the final flash…. after entering the new root password, the system shows the configuration menus etc.
  6. Now download the ‘big’ firmware file ‘dd-wrt.v24-15778_NEWD-2_K2.6_big.bin’
  7. It is then recommended to open a telnet session to the router and run some commands – in order to do this, it is necessary to allow ether ‘Telnet’ Management’ by clicking on the appropriate radio button on the ‘Administration’ tab > ‘Management’ sub-tab and then save the settings
  8. Open the telnet session (I used PuTTY on my Windows machine) and issue the ‘erase nvram’ and ‘reboot’ commands in succession — NOTE: for the Telnet session (as opposed to a web interface session) the username will be ‘root’ and the password to use will be the one you entered earlier
  9. Refresh your internet browser, which will display the ‘Change Password’ login prompt again
  10. Goto Firmware Upgrade option, and choose to load the new ‘big’ firmware – but take care to change the setting (which is on the same page as the file selection item: “After Flashing Reset to:” to “Reset to Default Settings ” option
  11. NOTE: the firmware update takes a few minutes to download and reset… wait patiently(!)
  12. You are again prompted to change user and password

Now you are done – Enjoy(!)

 

VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)

Adding fancy Graphs to Nagios (Ubuntu 10.04)

Nagiosgraph

NOTE: Before reading and implementing the processes listed in this post, I must point out that the original outcome of my installation of nagiosgraph on my Ubuntu 10.04 system (as I had previously blogged) was a complete failure. It took me some weeks and experimentation to find out why I encountered problems, and how to resolve them, ultimately, this turned out to be due to the fact that I had modified my vanilla Nagios installation with the NConf configuration plugin, and there were some consequent configuration file dependencies which were broken. These issues have now been resolved, and the correct installation process is documented below:

The original posting of this blog article was subtitled ‘FAIL’ and I am humbled, but extremely grateful to Mathew Wall (Nagiosgraph developer) for reading and responding to this earlier blog with some information which encouraged me further in diagnosing the problems I encountered. The graphing utilities provided by nagiosgraph are extemely configuable and very useful. Perfect for my purposes!

Installing Nagiosgraph:

prerequisites:

[instructions taken from nagiosgraph README]

Nagiosgraph will not function without a working Nagios installation, so first ensure that Nagios works. Version 3.2 or later is recommended, but older versions will also work.

Nagiosgraph requires rrdtool. Version 1.4 or later is recommended, but older versions will also work.

Nagiosgraph requires the CGI and RRDs perl modules. The RRDs perl module is part of rrdtool but is often distributed as a separate package. The GD perl module is optional, but recommended. The Nagios::Object perl module is optional, but useful for automatic configuration of showgroup.cgi.

Nagios version 3.2 is installed (using the instructions explained in my earlier blog post)

Install rrdtool: [currently this installs version 1.3.8 on Ubuntu 10.10]

sudo apt-get install rrdtool

Install perl modules and libraries using ‘apt-get’:

sudo apt-get install librrds-perl libgd-gd2-perl libnagios-object-perl

Install Nagios-Object perl, GD and CGI modules using CPAN from a terminal command:

sudo perl -MCPAN -e shell

cpan[1]> install Nagios::Object
cpan[2]> install GD

cpan[3]> install CGI
cpan[3]> exit

Install the Nagiosgraph application:

The current stable .deb package download (for installation on Debian or Ubuntu systems) is found at: http://sourceforge.net/projects/nagiosgraph/files/nagiosgraph/1.4.4/nagiosgraph-1.4.4-2.deb/download

cd to the directory where the download is saved

sudo dpkg -i nagiosgraph-1.4.4-2.deb

Configuring Data and Processing:

Before nagiosgraph can graph anything it must first collect data. There are two ways to process data – batch and immediate… we will be using batch processing

In batch processing, performance data are appended to a file, then nagios invokes insert.pl at a regular interval to update the RRD files.

Batch Processing

Before starting – make a backup of nagios.cfg

sudo cp /etc/nagios3/nagios.cfg /etc/nagios3/nagios.cfg.bkp

(1) Using your favourite editor, set the following changes in the Nagios configuration file (nagios.cfg):

firstly, make the /var/nagios directory:

sudo mkdir /var/nagios

[Then: sudo gedit /etc/nagios3/nagios.cfg]

process_performance_data=1
service_perfdata_file=/var/nagios/perfdata.log
service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-perfdata

(2) Make sure that service_perfdata_command is either commented out or not defined.

(3) Make sure that location of service_perfdata_file matches that of perflog defined in nagiosgraph.conf

[I Left as default: "perflog=/tmp/perfdata.log]

(4) In the Nagios commands file (commands.cfg) define the process-service-perfdata command:

[Firstly, Take a backup of the original commands.cfg]

sudo cp /etc/nagios3/commands.cfg /etc/nagios3/commands.cfg.bkp
sudo gedit /etc/nagios3/commands.cfg
define command {
command_name  process-service-perfdata-for-nagiosgraph
command_line  /usr/lib/nagiosgraph/insert.pl
}

(5) Restart nagios

sudo /etc/init.d/nagios3 restart

Configuring Graphing and Display

The web server must be configured to run the nagiosgraph CGI scripts.

The following directives are automatically added by the installation process to /etc/apache2/conf.d/nagiosgraph.conf

  ScriptAlias /nagiosgraph/cgi-bin /usr/lib/cgi-bin/nagiosgraph
  <Directory "/usr/lib/cgi-bin/nagiosgraph">
     Options ExecCGI
     AllowOverride None
     Order allow,deny
     Allow from all
  </Directory>
  Alias /nagiosgraph "/usr/share/nagiosgraph"
  <Directory "/usr/share/nagiosgraph">
     Options None
     AllowOverride None
     Order allow,deny
     Allow from all
  </Directory>

Restart the web server:

sudo /etc/init.d/apache2 restart

Verify that nagiosgraph is working by running showconfig.cgi

http://<your_server>/nagiosgraph/cgi-bin/showconfig.cgi

Try graphing some data by running show.cgi

http://<your_server>/nagiosgraph/cgi-bin/show.cgi

[from the nagiosgraph README]:
“…This should display a web page with a list of your hosts and services.
Note that it might take a few minutes for data to collect, so at first the
list of hosts and services might be sparse and the graphs might be empty.

There are a few ways to embed graphs into nagios. In the service and
host listings, Nagios will display graph icons that, when clicked, will
open a new web page with graphs. These icons are typically per-host
(linked to the showhost.cgi script) or per-host-service (linked to the
show.cgi script). Nagios will display graph data when the mouse is moved
over the graph icon for each host/service. Finally, graphs can be displayed
directly in the Nagios frames. The following sections explain how to do each
of these…”

Troubleshooting:

Originally, I followed the instructions [as found in the nagiosgraph README] for modification of the default nagios configuration file: /etc/nagios3/nagios.cfg (or in my case, since I have configured my Nagios setup to be easily managed by NConf, my configuration file is /etc/nagios3/global/misccommands.cfg)… this led me into some problems which are documented below.

However, after a few installation retries, and in gaining some further understanding the configuration necessities of Nagiosgraph (and also my non-stanadard, but very helpful, NConf configuration), I found that the resolution to the main problem – I.e. Not being able to display graphing details because of a “No data in rrd directory /var/spool/nagiosgraph/rrd” error when going to the show.cgi webpage – was due to the fact that there was no “process-service-perfdata-for-nagiosgraph” command in the nagiosgraph configuration file(!)

The problem is documented below, and also some diagnostic information which may be helpful in trying to track down some similar issues:

 

Problem: No data in rrd directory

Originally, in checking the ‘show.cgi’ page on my server, I received an error! – “No data in rrd directy /var/spool/nagosgraph/rrd”

Nagiosgraph Error

I was able to reproduce the same error when I ran insert.pl from the commandline…

Nagiosgraph error - running insert.pl from commandline

…But, if I ran the command as sudo, then it ran correctly… so the problem seemed to be related (at least in part) to some kind of permissions problem(!)

sudo chown -R nagios:nagios /var/spool/nagiosgraph/
sudo chmod -R 777 /var/spool/nagiosgraph/

This allowed me to run the insert.pl command without errors on the commandline… but I was still not seeing any data being written to /var/spool/nagiosgraph/rrd directory(!)

I then ran the command again and received the following error: “Cannot write to /var/log/nagiosgraph/nagiosgraph.log”. This was not a dramatic problem, but needed to be fixed

Nagiosgraph Error - Cannot write to log

‘nagiosgraph.log’ existed… but it had incorrect file permissions assigned. I did the following:

sudo chown nagios:nagios /var/log/nagiosgraph/nagiosgraph.log

I checked the perl code in insert.pl incase there was some information on diagnosing problems, or running the script in a ‘debug mode’ etc…  I found the following infomation:

CONFIGURATION

The nagiosgraph.conf file controls the behavior of this script

DIAGNOSTICS

Use the debug_insert setting in nagiosgraph.conf to control the amount of logging information that will be emitted by this script. Output will go to the nagiosgraph log file

The configuration file and ngshared.pm must be in this directory

use lib '/etc/nagiosgraph';

(1) I modified the ‘nagiosgraph.conf’ to provide detailed logging information…

Set ‘debug = 5′ (default was ’3′)

Uncomment ‘debug_insert = 5′ (in order to debug running of the ‘insert.pl’ script)

There were a lot more available (specific) debug levels which could be set, but I decided to keep it simple for now

(2) The configuration file ‘nagiosgraph.conf’ and the perl module ‘ngshared.pm’ were correctly installed into my /etc/nagiosgraph directory – but the directory and file permissions were not did not seem correct (Onwer = <unknown user>) and there were restrictive permissions on reading the files

sudo chown -R nagios:nagios /etc/nagiosgraph/
sudo chmod -R 775 /etc/nagiosgraph/

I also checked to see if there was any performance data being reported in the log: /var/nagios/perfdata.log… there was NO log, so I created one, and assigned permissions accordingly:

sudo touch /var/nagios/perfdata.log
sudo chown -R nagios:nagios /var/nagios/
sudo chmod -R 777 /var/nagios/

I then retried running the insert.pl script, with the following results – so it appears to be running OK, but not getting any data from the perfdata.log

No data in /var/nagios/perfdata.log

More diagnostic possibilities…

I found a brief description online of how this whole process is supposed to work:

“…nagiosgraph gets its data from the “perfdata.log” file that is written by Nagios (to /var/spool/nagios by default). insert.pl is called by nagios, and reads the perfdata.log file to get the performance data and insert it into the RRD databases”

More searching revealed that my issue *could* be ‘Map file’ related – /etc/nagiosgraph/map

I also located a method for testing entries for ‘Map files’ by running: perl /usr/share/nagiosgraph/util/testentry.pl

Another internet post identified that:

“…insert.pl is probably not recognizing the plugin output/perfdata. if this is the case, you’ll see log messages about ‘perfdata not recognized’. to fix this, ensure that you have a map rule that matches the plugin output/perfdata. you can use testentry.pl to help with this. see also the section ‘Adding Service Types’ in INSTALL”

My Problem Resolution:

More internet searching exposed a possibility – check the Apache logs(!) /var/log/apache2/error.log – this indeed showed that there was “No data in rrd diretory /var/spool/nagiosgraph/rrd”

However, I found that the ‘commands’ required to populate rrd data were defined in the /etc/nagiosgraph/nagiosgraph-commands.cfg file. The only command defined in this (automatically generated file) was called process-service-perfdata-for-nagiosgraph and the associated command line paramater was defined in order to run insert.pl from the /usr/lib/nagiosgraph/ directory (which is correct)

So… the resolution to my issue was to ensure that this command was also correctly reflected in my nagios configuaration file: /etc/nagios3/global/misccomands.cfg (but in a standard nagios installation on Ubuntu, this would be (and should be added by default during the automated Nagiosgraph installation process) in the /etc/nagios3/commands.cfg file

 

VN:F [1.9.16_1159]
Rating: 8.0/10 (4 votes cast)
VN:F [1.9.16_1159]
Rating: +2 (from 2 votes)

Monitor Remote Windows Host network traffic with Nagios

Using SMTP, and a Nagios plugin called ‘Check_bandwidth3′ it is possible to monitor network traffic from Remote Windows hosts using Nagios3

Prerequisites:

  • Nagios – (see my earlier blog post for installation/configuration of Ubuntu 10.10 system)
  • Perl – (this is installed by default on Ubuntu 10.10 system)
  • Perl Net::SNMP module

In my case, the prerequisites were all satisified apart from the Perl SNMP module… install it like this:

sudo perl -MCPA -e shellinstall Net::SNMP

(We will later copy the ‘check_bandwidth3′ program to /usr/lib/nagios/plugins/ directory for usage…)

  • Configure SNMP on a Windows Client – for ‘Read-Only’ access

Configuring SNMP on the Windows Host

This is my Windows Client SNMP Configuration:

Set the SNMP to start Automatically, and Start the service

Then configure the ‘Agent’ according to the settings in the ‘Agent’ tab (shown below)…

Set SNMP service to 'Automatic' and Start

Select the ‘Agent’ tab – add a ‘Contact’ and ‘Location’, and select the ‘Services’ which are appropriate to your configuration

Agent Configuration

Goto ‘Traps’ tab, add a ‘community name’ (e.g. SKDSNMP.RO) and click on ‘Add to List’ button…

Add an SNMP 'Community Name' which can be accessed

In ‘Trap Destinations’ section of the same window, click on the ‘Add’ button to add a ‘Trap Destination’, then type the IP address of the Nagios Server, and Save changes…

Add a 'Trap Destination'

In the ‘Security’ tab of the SNMP Service configuration, Add the ‘Community Name’ (which we nominated earlier) to the Communities which are able to be tranmitted via the network, and set this community to be READ ONLY…

Add 'Community Name' in 'Security' tab and set to type = 'READ ONLY'

Then, perhaps it is a good idea to add some security to the SNMP service by at least limiting access to the service by certain hosts (see service configuration change below where I have added the IP address of the Nagios host, and changed access by listed hosts only)

Add Remote Host who can access SNMP informaiton

Add the Nagios Host IP and set access by named hosts

It *MAY* be necessary to modify the Firewall rules on the Windows Host to allow access by the SNMP port (UDP Port 161). This was certainly necessary on one of the Windows machines which I was monitoring before I could connect from the Nagios host using the ‘Check_bandwidth3′ plugin.

Add Firewall port for UDP port 161

Our Windows Host should now be ready to serve SNMP information to our Nagios Server command-line… the output should be identical to the earlier test

Installation/Configuration of the ‘Check_bandwidth3′ plugin to work with Nagios:

  • Unpack package into a temporary directory. (eg: /tmp) and copy the ‘Check_bandwidth3′ script into your plugins directory [/usr/lib/nagios/plugins/]
sudo cp check_bandwidth3 /usr/lib/nagios/plugins/
  • By default, check_bandwidth3 will store all cache files under the directory /tmp/.traffic. If you want to change this, please edit the file and change the $_storage variable towards the top, or use –save command-line option. [I left this as default]
  • Make sure ‘Check_bandwidth3′ can create and/or write to the $_storage directory

Run a test to see if we can remotely access Windows Host NIC details:

We can now test to see if we can obtain the bandwidth information of a network interface on our remote Windows Client using the following command (on our Nagios Server)

sudo /usr/lib/nagios/plugins/check_bandwidth3 --interface v1://192.168.1.16/SKDSNMP.RO:1

The output from this command is shown below:

Obtain NIC bandwidth details from Remote Windows Client

Test the plugin from the Nagios server on the commandline

Configure Nagios to use ‘Check_bandwidth3′ plugin:

With a working ‘Nagios’ and ‘NConf’ configuration (see my earlier blog posts) we can now configure the Nagios server to use the ‘Check_bandwidth3′ plugin, along with the command-line attributes that we require (see ‘./check_bandwidth3 –help’) for full details on all available options.

Goto the administration view of NConf in a browser (probably http://yourhost/nconf).

Create a new ‘Checkcommand’:

Find in the menu on the left hand side of the screen an item called ‘Checkcommands’ and click on the ‘Add’ link. It will take you to a window (as shown below) where it is possible to configure a new base ‘Checkcommand’ which we will use to check bandwidth settings on our remote hosts

The new ‘Checkcommand’ form has some predefined fields which can be populated by details which we used in our command-line test (above). Here we can provide variables which will be injected into the command when it is being sent by Nagios to a remote host

Create the ‘Checkcommand’ as follows:

Checkcommand Name – [this can be any name you like, but pays to choose a sensible and meaningful name]

check_bandwidth3

Check Command Line – [this is the command which will be generated by Nagios when we are querying a remte host]

$USER1$/check_bandwidth3 --interface $ARG1$://$HOSTADDRESS$/$ARG2$:$ARG3$

Command description - [a description which will be helpful for the administrator to know what the Arguments to the above command refer to]

ARG1=Protocol Version,ARG2=SNMP Community, ARG3=NIC

Amount of Params – [this refers to the Number of Arguments which will be passed into the command when executed by Nagios]

Change this item to '3'

Now save the configuration of this new ‘Checkcommand’ – We will be referring to this in the next section (your configuration should look somthing like this):

Create a 'Checkcommand' for using the 'Check_bandwidth3' plugin within Nagios

Create a new Host-Specific Service:

Find in the menu on the left hand side of the screen an item called ‘Services’ and click on the ‘Add’ link. It will take you to a window (as shown below) where it is possible to configure a new host-specific ‘Service’ which we will use to administer our Windows Host

Add the following details in this form:

Service Name – Provide a unique name for this Host Specific service

Check Command – Choose from the pulldown menu the  ‘Check_bandwidth3′ command (which we configured in the previous section)

Assigned to Host – Choose from the pulldown menu the host which we want to monitor (this host must have been configured to share SNMP details as discussed in the previous section)

Check Period – At this stage, we are keeping it simple, so choose the default ‘Check Period’ = 24×7

Add a new 'Service' for a specific host

The settings should look similar to those shown in the screenshot above. Save these settings then click on ‘Services’ and click on the ‘Show’ link on the left hand side of the screen… choose the newly created ‘Service’ and click the corresponding icon (which looks like a pencil) on the Right-Hand side of the screen – this will allow you to edit the service settings (see below)

Find the new 'Service' and choose 'Edit'

The interface will return you to a screen which is very similar to the one which we originally used to create the new ‘service’, however, now there are items at the bottom of the screen which can be edited in order to specify the variables which should be used as ‘Arguments’ when Nagios is sending the command to the specifed host… in this case, we want to:

- Use Version 1 of the SNMP protocol: [so ARG1 = v1]

- Use the Community Name: [so ARG2 = SKDSNMP.RO]

- Obtain details of the 1st NIC on the Windows Server which I am monitoring: [so ARG3 = 1]

Edit the Arguments which should be passed by Nagios to the 'Check_bandwidth3' plugin when monitoring THIS host

Click on the ‘Submit’ button to save your changes

 

Synchronise the Changes to Nagios Configuration:

Finally, we need to ‘Regenerate the Nagios Configuration’ in order to load the selected changes into the Nagios config files, and for the Nagios system to start monitoring this Host… Choose the item called ‘Generate Nagios Config’ from the menu on the Left-Hand side of the screen

Generate Nagios Config to sync changes to the Nagios system

The changes should take a few seconds to sync, and you should get the following response. Pay attention to the ‘Syntax Check’ at the bottom of the response… if there are any problems, expand this section and find out if there are any syntax issues with your newly created service’

Configuration has been Synchronised to Nagios

Review the Configuration Changes in Nagios:

At this point, Nagios should be configured to start monitoring bandwidth of your Windows host. It does take a few minutes for this configuration ch (anges to be displayed in your Nagios web front-end (Goto http://<your_host>/nagios3 – login, and choos the ‘Service Detail’ option on the Left-Hand side of the screen)

Nagios front-end - 'Service Detail'

If your changes are not evident after a few minutes, it may be necessary to reload Nagios daemon.

sudo /etc/init.d/nagios3 reload

Eventually you should see the newly configured host-specific bandwidth monitoring service appear in the ‘Service Details’ section… it may look something like the following screenshot – but (as you can see) I have a permissions problem with the Nagios user not being able to write to the /tmp/traffic/192.168.1.16/1 directory

Problems with the Host Monitoring - privileges on /tmp/.traffic directory (on Nagios server)

I can resolve this problem by performing the following commands (which are (1) a ‘recursive’ request to change ownership of the /tmp/.traffic directory for the ‘nagios’ user, and (2) a ‘recursive’ modification of privileges on the /tmp/.traffic directory to ensure that it is writable by the nagios process user):

sudo chown -R nagios:nagios /tmp/.traffic/

sudo chmod -R 755 /tmp/.traffic/

Checking the ‘Service Detail’ section of Nagios interface after a few minutes, I can see that the modification has allowed Nagios to report on the bandwidth of the remote Windows NIC

The Remote Windows Host network bandwidth is now being monitored by Nagios

Addendum:

check_bandwidth3 checks on 64-bit Hosts

Since writing this blog post, I have been emailed on more than one occasion by users who have not been able to get the ‘check_bandwidth3′ Nagios plugin to work as it was described above.

I have not had the chance till now to test this functionality for myself due to having been using Nagios to monitor a predominantly 32-bit Windows Host environment. Today, I was able to confirm that the plugin indeed DOES work for checking bandwidth on 64-bit hosts, but enabling the functionality was somewhat different from what I expected and was used to from the 32-bit hosts which I had configured previously.

The configuration for a 64-bit host is indeed no different from that which must be considered (and has been documented above). The secret to receiving a reliable response from the 64-bit host is in correctly determining the so-called ‘Interface Number’ for the host which you are targeting.

I have said previously regarding the Windows 32-bit hosts that the (default, primary) NIC ‘Interface Number’ to target when executing a ‘check_bandwidth3′ command is often either ’1′ or ’65539′ (I have no idea why 65539 appears to be commonly used by the Windows environment for the default LAN NIC – it just is). In the case of the Windows Server 2008 R2 (64-bit) host which I configured today, I received (positive) replies from the ‘check_bandwidth3′ program which indicated ZERO network traffic was being transmitted via the (unused) ports – See example below:

Example 'check_bandwidth3' check on WRONG 'interface' of 64-bit Windows Host

In the above screenshot, I am logged in to the remote Nagios Server (using Putty) as the user = ‘nagios’ – this is important, because the user must have read/write access to the default storage location on the server where the data will be written to.

The SNMP Community String I am using = ‘Data’ and the Windows Host is configured to accept and return SNMP to the Nagios Host (as described in post above)

The important thing to notice in the above screenshot is that there is ZERO traffic being transmitted via the targeted ‘Interface’ (in this case, :1).

I do not yet have a foolproof way to identify the correct host ‘interface’ to target so, in my case, trial and error has been the method of choice (perhaps somebody can provide a mechanism which makes this task easier?). The screenshot below shows the ‘check_bandwidth3′ tests which I performed from the commandline on the Nagios server to identify the correct ‘Interface’ number to target. In my case, I was concurrently performing a large file transfer to the target host to be sure that I would notice when I identified the correct ‘Interface’ number.

Identifying the correct NIC 'Interface' number for 'check_bandwidth3' on Windows Host

The above screenshot shows the methodical iteration testing performed with the ‘check_bandwidth3′ on Nagios server command-line in order to identify that the correct ‘Interface’ number to target should be (in my case) #11

NOTE: you will also see that the last test performed (in the above screenshot) was for ‘Interface’ number = 12. This interface number returned a negative response from the ‘check_bandwidth’ program which seems to indicate that the other tested interfaces were apparently still ‘valid’ Windows Host interfaces, but were simply not correct for our purposes.

The last step in correctly configuring your Nagios installation is to correct your Nagios configuration (as described above) to change the ‘Interface’ number accordingly, then save changes

VN:F [1.9.16_1159]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.16_1159]
Rating: -1 (from 1 vote)

Install Nagios on Ubuntu 10.04 (Lucid) on Asus EeeBox PC

Asus EeeBox PC specs:Dual Intel Atom D410 1.66GHz CPU

WD 250GB Hard Disk

2 GB RAM

Atheros Communications AR9285 Wireless NIC

JMicron Technology JMC250 PCI Gigabit Ethernet NIC

Intel N10 Family Integrated (VGA Compatible) Graphics Controller

 

Using (and embellishing upon) instructions for Installing Nagios and Nconf on Ubuntu 10.04 http://digitalcardboard.com/blog/2010/08/24/nagios-and-nconf-on-ubuntu-10-04-lucid-lynx/

 

Prerequisites

Download and install Ubuntu 10.04

Install Ubuntu 10.04 on Asus EeeBox PC

Perform Ubuntu System Updates – (restart system if required)

If you didn’t check the box to configure your box as a LAMP (Linux, Apache, MySQL, PHP) server when you first setup your box, do that first with:

sudo apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5

During the installation of these packages – Type a root password for mysql to continue

 

If you want phpMyAdmin (for web-based MySQL administration):

sudo apt-get install phpmyadmin

During installation:

- Choose ‘apache2′ as the ‘Webserver to reconfigure automatically’ for phpMyAdmin package

- Choose to ‘Configure database for phpmyadmin with dbconfig-common’

- Enter Admin Database user password (in order to make changes for phpmyadmin)

- Provide a phpmyadmin databasae user password

 

Installing Nagios

Install Nagios with

sudo apt-get install nagios3

During Installation/Configuration:

- Choose ‘Internet Site’ for mail server configuration
- Provide a ‘System Name’ (I left as ‘Nagios-Server’ <default>)
- Enter a Nagios Web Administrator Password

 

Test the installation by browsing to http://<yourserver>/nagios3

At this point, I could not log into the webserver at http://Nagios-Server/nagios3, using user = root, and password = <root password, as supplied>… But I was able to log into the mysql backend using the terminal, user = root, and the password = <root password, as supplied>

I thought perhaps this was a typo(?),  so I found a mechanism for changing the password: Simply open a terminal and run the following command:

sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin – you are then requested the root password (for sudo privileges) then type a new ‘nagiosadmin’ password. Then it dawned on me… I needed to use the username = ‘nagiosadmin’ to view the administrative localhost nagiosadmin site at http://Nagios-Server/nagios3

I was able to log-in and test the configuration(!)

 

If you would like to monitor Windows servers using NSClient++ (which I am doing), also install the NRPE plugin with

sudo apt-get install nagios-nrpe-plugin

Backup the config files before you start messing with them, so I backed them up with

sudo cp -r /etc/nagios3 /etc/nagios3.backup

 

Installing NConf

NConf provides a web-based frontend for configuring Nagios.  There’s no package in the Ubuntu repositories for it, but you can download it pretty easily.  Version 1.2.6 was the latest as of the time of this writing, so make sure you’re getting the latest version.  (Note: it looks like the link below gets cut off, so here’s a link to the NConf download page where you can grab the latest source)

wget http://sourceforge.net/projects/nconf/files/nconf/1.2.6-0/nconf-1.2.6-0.tgz
Unpack it to your webroot:
sudo tar xzvf nconf-1.2.6-0.tgz -C /var/www
Change the owner of the folder and files you just extracted to the web user:
sudo chown -R www-data:www-data /var/www/nconf
Now you’ll need to create a MySQL database to hold the NConf configuration data.  Using phpMyAdmin – goto the localhost address: http://Nagios-Server/phpmyadmin, and perform the following:
  • Privileges -> Add a new User
  • User name: nconf
  • Host: localhost
  • Password: <whatever you like>
  • Create database with the same name and grant all privileges
  • Global Privileges – Check All
  • Go
  • Privileges -> reload the privileges

Then browse to http://<yourserver>/nconf and follow the prompts (after clicking the ‘click here’ prompt beside the ‘Setup Required’ prompt on the RHS of the Admin page) to finish initial configuration of NConf.

When you get to the database configuration page – Go through the ‘Setup’ procedure: Fnter nconf for the username and the database name, and use the generated password you should have made a note of earlier. For most everything else, accept the defaults, but change the NAGIOS_BIN variable to /usr/sbin/nagios3 to reference the right location.

Finally, remove the folders and files referenced at the end of the installation process:

sudo rm -r /var/www/nconf/INSTALL
sudo rm /var/www/nconf/INSTALL.php
sudo rm -r /var/www/nconf/UPDATE
sudo rm /var/www/nconf/UPDATE.php

At this point, you should be able to login to NConf, although it won’t be doing anything of importance (as yet)

 

Configuring Nagios to use NConf

At this point, Nagios is able to find at display working ‘services’ on ‘localhost’ and even established a ping service to my internet gateway without any user generated configuration – but defining new hosts within the NConf interface itself, and clicking Generate Nagios config, did not sync the changes back to Nagios – so the configration files do not seem to match…

 

We’ll need to make some changes to one of the Nagios configuration files, so (using sudo) open up /etc/nagios3/nagios.cfg in your favorite editor and delete or comment out all the lines that begin with cfg_dir= or cfg_file= and add the following lines:

cfg_dir=/etc/nagios3/global

cfg_dir=/etc/nagios3/Default_collector

It is then necessary to create the destination folders mentioned above:

sudo mkdir /etc/nagios3/global
sudo mkdir /etc/nagios3/Default_collector

Then, back at the terminal, we run the following command to create a folder for NConf to dump the configuration files it generates.

sudo mkdir /etc/nagios3/import

 

Configuring NConf to Deploy Nagios Configurations Automatically

Almost there. Using sudo, open up /var/www/nconf/ADD-ONS/deploy_local.sh and make the following changes to paths:

OUTPUT_DIR="/var/www/nconf/output/"
NAGIOS_DIR="/etc/nagios3/"

and modify the command (in the file) to read:

/etc/init.d/nagios3 reload

NOTE: Also make sure this file is executable! (I had to "chmod 755" this file before I stopped getting nagios reload errors)

This script will deploy the generated configuration package and then reload the running instance of Nagios, but it’s easiest to use just installed in the root crontab.

sudo crontab -e

and adding the line

* * * * * /var/www/nconf/ADD-ONS/deploy_local.sh

 

Final Steps

After saving and closing the root crontab, log back into NConf and take a look around.  You’ll see some sample definitions and some predefined services for the localhost computer.  You may want to delete the check_local_mrtgtraf and check_local_procs services, as the first one doesn’t work without additional configuration and the second one is a sample definition, but you can make those changes at your leisure.

Once you’re ready, click Generate Nagios config, and if all goes well, you’ll see something like the following:

[ Initializing NConf perl-API (library version 0.2, written by A. Gargiulo) ]
[ Copyright (c) 2006-2009 Sunrise Communications AG, Zurich, Switzerland    ]

[INFO]  Starting generate_config script
[INFO]  Generating global config files
[INFO]  Generating config for Nagios-collector 'Default Nagios'
[INFO]  Ended generate_config script

Running syntax check:

Default_collector:	 Total Warnings: 0  Total Errors: 0
Changes updated successfully.

Now log back into Nagios and click on Service Detail.  Within a minute or two, you should see the hosts and services change to reference the configuration as generated from NConf.

If that works, then huzzah!

Start making your configuration changes in NConf and enjoy not having the manipulate those Nagios conf files by hand anymore!

Acknowledgements:

Many thanks to the author (Jason) of DigitalCardboard.com for his excellent step-by-step guide which is used as the basis for this post

VN:F [1.9.16_1159]
Rating: 7.0/10 (3 votes cast)
VN:F [1.9.16_1159]
Rating: +1 (from 1 vote)

Cisco VPN Client not allowed through Firewall

I identified a problem when trying to access Cisco VPN services via the web from a remote location (using the Cisco VPN client on a Windows PC). However, it turned out that these sites/services were accessible from within other networks – this led me to believe that the firewall configuration at the remote location was causing my problem.

A little research revealed that it was necessary to configure some non-standard ports to enable this functionality:

I enabled the following ports on the remote site firewall to successfully provide connectivity:

Port number: 500
Protocol type: UDP
Direction: Send Receive

Port number: 4500
Protocol type: UDP
Direction: Send Receive

The (unnoficial, user-provided) information I had reviewed on the internet to provide this functionality also suggested the following port – however, this was not required in my instance to achieve connectivity.

Port number: 10000
Protocol type: UDP
Direction: Send Recieve

My System Configuration related to this problem:

  • Windows 7 Professional x64 system
  • Cisco VPN Client version: 5.0.07.0290
VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)

MythTV Configuration

This is how I successfully installed/configured MythTV on my system:

System: Thermaltake DH101 system

O/S: Linux Mint Debian Edition

DTV Card: Hauppauge WinTV-HVR-2200

 

Find the available Debian Packages:

Most of these packages were already installed by default… but I did have to install the following (using “apt-get install <package_name>”)

mythweb

nuvexport

libmyth-dev

mythbrowser

mythnetvision

mythnetvision-data

mythplugins

mythtv-perl

To configure MythTV, it is then necesarry to run ‘mythtv-setup’ from a terminal prompt → I then encountered a problem: cannot log into database as ‘mythtv’ with pwd = ‘mythtv’ (found in file: /home/steve/.mythtv/mysql.txt)

There are other ways to fix this problem, but the easiest method available to me was to install Webmin (and prerequisites), along with mysql-admin packages

Surprisingly, I then had to change default locations for mysql binaries within Webmin Configuration… then I could log into mysql database from within Webmin as root, then configure mythtv database access (user: mythtv pwd: mythtv)

I live in Melbourne, Australia and have found from previous experience with MythTV, that the easiest way to configure xmltv and download free-to-air Digital TV program listings for my region is by installing and using the free ‘Shepherd’ application… Install Shepherd using instructions from http://svn.whuffy.com/wiki/Installation

Now run ‘myth-setup’ to configure the mythtv backend

There are 6 sections which must be configured in sequence when configuring MythTV.

  1. General
  2. Capture Cards
  3. Video Sources
  4. Input connections
  5. Channel Editor
  6. Storage Directories

The ‘General’ section defaults, are normally OK, but it is necessary to modify the IP Address for the ‘Master Backend’ – Often, if you are using the same machine for Backend and Frontend, then a localhost address (i.e. 127.0.0.1) or the statically assigned local address for your PC on your local LAN (e.g. 192.168.75.1) is sufficient

The ‘Capture Cards’ section must be configured to suit the TV card which is installed in your system. My system was using a ‘Hauppauge WinTV-HVR2200′ PCI card – the following screenshots show the configuration options which were necessary to get my system operational (Note: see my earlier post for installing firmware and configuring Debian system to identify and use this DTV card)

There is only 1x TV card installed in this system, but the screenshots below show that this card supports two recording channels

 

The ‘Video Sources’ and ‘Input Connections’ configurations are reasonably straightforward. I configure the system for ‘PAL’ TV format, and ‘Australian’ settings. (This is configured by the previously installed ‘Shepherd’ application)

I had to manually start mythbackend (by typing ‘mythbackend’ into a terminal prompt) before I could connect with the mythtv-frontend – otherwise it told me that the service was not running – the automatic starting of the MythTV daemon is something which has yet to be resolved for my setup

Interestingly, a ‘Channel Scan’ rom within the ‘Input Connections’ screen, or ‘Channel Editor’ screen only exposed some out of the possible free-to-air digital TV channels from nearby central Melbourne (when my set-top TV box is able to view all local TV channels perfectly)… I was not able to configure any of the ‘Nine’ channels (e.g. ‘Nine Digital’, ‘Gem’ and  ‘Go’). I found out that it was necessary to manually add the Channel Nine information… I found the frequency information using a Google search: (191625000 MHz)and I was able to add this manually via the ‘mythtv-setup’ program and the ‘Edit Transports’ section of the ‘Channels Editor’ menu

 

But then I found some more information from another Melbourne-based MythTV user who had lost SBS and Channel 9 after a rescan in December 2010 (http://www.mythtv.org/pipermail/mythtv-users/2010-December/304062.html)… It seems that incorrect details for the ‘transport’ for Channel 9 was inserted into the MythTV database!

Ultimately, I needed to manually edit the MYTHCONVERG.dtv_multiplex table as shown below:

 

(Channel Nine: netid = 4114, tid = 1072) – this is what it should look like:

 

I then deleted all of the already scanned/configured channels, and rescanned… the system found 23x channels, including 9, 90 and 99

Starting ‘mythbackend’ and then ‘mythfrontend’ I was then able to select and view all channels perfectly!

 

 

    1. ‘mythweb’

    2. ‘nuvexport’

    3. libmyth-dev

    4. mythbrowser

    5. mythnetvision

    6. mythnetvision-data

    7. mythplugins

    8. mythtv-perl

VN:F [1.9.16_1159]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.16_1159]
Rating: 0 (from 0 votes)