NCP Server Connection Stats

0 Likes

Today I will show you how I collect all our NCP Server connection stats to one central database and how I then create nice graphs out of this data. If you run Novell’s OES 2 on Linux and if you have a Novell Cluster environment you might be interested in this. You get a quick overview of your past connection stats with minimal effort.



What I do to get this done consists of two parts:




  1. Client-Side

    On every server / node I like to get the connection stats from, I executed every 15 minutes a perl script through cron. This script gets the stats and writes them to a central (my)sql database.

  • Server-Side

    On the “server-side” the sql server with the needed database is running. Furthermore it runs another perl script with is accessible via CGI through a browser. This script reads the data from the sql server and generates some nice graphs out of it. The script uses jquery and google’s chart api for that job.



Let’s get a bit deeper on both parts:




  1. Client-Side

    With an “/sbin/ncpcon connections” you get an output where you find different NCP connection information – see Novell’s NCP Server Documentation. My perl script is using this command, greps for the connection quantity and writes this information including the host-name and time-stamp to a defined mysql database table. The script is executed by cron every 15 minutes.



    This is the needed cronjob for every server / node:

    0,15,30,45 * * * * constats.pl


    see attached constats-cron.txt

    This is the perl script to write the stats to the sql database:

    see attached constats.pl.txt



  • Server-Side

    This is the sql database table structure:

    see attached statistics_db_table.sql.txt

    If this is now running, you have the ncp stats for every server or node where you run the script in the sql database. The data in the sql database looks like this:

    see attached statistics_db_table_select.txt

    To get some nice graphs out of this data I use google’s chart api though jquery with another perl script which is accessible via CGI through a browser. It reads the sql table and creates by default a graph for today. It can also create a graph for any other day if it is executed with an “DATE” argument. The graph’s x-axis goes from midnight till midnight with one value for each hour. Therefore the script first consolidate the four values for each node out of the sql database to one and then it uses the chart api to draw the graph.



    Example:

    http://server/cgi-bin/viewconstats

    viewconstats




    http://server/cgi-bin/viewconstats?20091228

    viewconstats



    This is the perl script to generate the graphs:

    see attached viewconstats.pl.txt




That’s all



I’m already thinking about changing the script to make it more flexible (e.g. one week/month/year graphs) or maybe use rrdtool and a rrd file rather than a sql table, also an integration into our Nagios system would be nice but for now it works for me. It isn’t perfect but it does the job…



How do you save your OES2 specific server stats?



Find the original blog entry here (and use it for comments):
http://opt.imi.st/ncp-server-connection-stats



By the way, this is my first Novell Cool Solution's Entry. More will follow soon...


Sorry about all the spelling errors, I hope you enjoyed it anyway

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended