Install - Host template for MSSQL Server 2000 --> No data

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

wincakti
Posts: 2
Joined: Thu Dec 08, 2011 5:44 am

Re: Install - Host template for MSSQL Server 2000 --> No dat

Post by wincakti »

Thanks for the tip.

I tried running rrdtool 1.4.4 today (windows build) but that did not do the updates on the RRD's anymore.
I also could try 1.2.30 but thats a build for perl 5.10 and not perl 5.8 (as I run Wamp) perl 5.8.9 is included but will try that also.

Any idea why if I use 1.4.4 my RRD's are not updated. Can not see any info in tha cacti log about that.

Chrs
lints
Cacti User
Posts: 107
Joined: Thu Nov 08, 2007 2:00 pm
Location: Ottawa, Canada

Re: Install - Host template for MSSQL Server 2000 --> No dat

Post by lints »

I have to admit that I'm not sure... One would think that if 1.4.4 works, it would work everywhere.

With 1.4.4 do the graphs display properly, or do you have the same issues?

Perhaps you can post that issue as a new thread in the 'Help: General' forum.

Do all the rrds have data in them at least?
Cacti Version - 0.8.7e
Plugin Architecture - 2.4
Poller Type - Cactid v
Server Info - Linux
Web Server - Apache/2.2.3 (CentOS)
PHP - 5.2.10
MySQL - 5.1.35-log
RRDTool - 1.4.4
------------------------------
As of March 23rd:
Hosts - 564
Graphs - 15274
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: Install - Host template for MSSQL Server 2000 --> No dat

Post by geoffg »

I am trying to get this running on php 7.1 on ubuntu
First you need to install this:
https://www.microsoft.com/en-us/sql-ser ... php-ubuntu to get the connection stuff

make the connection string look like this:

Code: Select all

function ss_win_mssql ($hostname, $cmd, $username = NULL, $password = NULL) {
        list($host, $port) = explode(':', $hostname);
        $port = ($port == '' ? '1433' : $port);
        $username = ($username == NULL ? 'cactistats' : $username);
        $password = ($password == NULL ? 'br0k3nd0wn' : $password);
    $connectionOptions = array(
        "Database" => "master",
        "Uid" => "cactistats",
        "PWD" => "br0k3nd0wn"
    );
    //Establishes the connection
    $conn = sqlsrv_connect($hostname, $connectionOptions);
AND:

Code: Select all

               /*if (! $link = mssql_connect($host.':'.$port, $username, $password) )*/
                if (!$conn)
                        return;
(you can change the variables as you like, I just used Mr M$'s script as an example as I am not a coder.

Then you meed to change every instance of mssql_(query, etc) to sqlsrv_(query, etc)

So far, that has got me connected to the MSSQL DB, but I do not get any output:

Code: Select all

xxxxx@xxxxxxx:/home/xxxxx# php -q /usr/share/cacti/site/scripts/ss_win_mssql.php 192.168.2.1:1433 connections

xxxxx@xxxxxxx:/home/xxxxxx#
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: Install - Host template for MSSQL Server 2000 --> No dat

Post by geoffg »

more info:

Code: Select all

#1 {main}
  thrown in file: /usr/share/cacti/site/scripts/ss_win_mssql.php on line: 43

Code: Select all

/*list($server_version) = sqlsrv_fetch_row(sqlsrv_query("SELECT SERVERPROPERTY('productversion')"));*/
                list($server_version) = sqlsrv_fetch(row(sqlsrv_query("SELECT SERVERPROPERTY('productversion')")));
This fixed the error, but now I have:

Code: Select all

#1 {main}
  thrown in file: /usr/share/cacti/site/scripts/ss_win_mssql.php on line: 44
Line 44:

Code: Select all

                $sql = "SELECT [counter_name], [cntr_value] FROM ".$perf_counter_table." ".
                        "WHERE ([instance_name] = '' OR [instance_name] = '_Total') AND (".
                        "([object_name] LIKE ('%Plan Cache%') AND [counter_name] IN ".
                          "('Cache Hit Ratio', 'Cache Hit Ratio Base')) OR ".
                        "([object_name] LIKE ('%Buffer Manager%') AND [counter_name] IN ".
                          "('Buffer Cache Hit Ratio', 'Buffer Cache Hit Ratio Base', 'Page reads/sec', 'Page writes/sec')) OR ".
                        "([object_name] LIKE ('%General Statistics%') AND [counter_name] IN ".
                          "('Active Temp Tables', 'User Connections')) OR ".
                        "([object_name] LIKE ('%Databases%') AND [counter_name] IN ".
                          "('Transactions/sec', 'Log Cache Hit Ratio', 'Log Cache Hit Ratio Base', 'Log Flushes/sec', ".
                            "'Log Bytes Flushed/sec', 'Backup/Restore Throughput/sec')) OR ".
                        "([object_name] LIKE ('%Access Methods%') AND [counter_name] IN ".
                          "('Full Scans/sec', 'Range Scans/sec', 'Probe Scans/sec', 'Index Searches/sec', 'Page Splits/sec')) OR ".
                        "([object_name] LIKE ('%Memory Manager%') AND [counter_name] IN ".
                          "('Target Server Memory (KB)', 'Target Server Memory(KB)', 'Total Server Memory (KB)')) OR".
                        "([object_name] LIKE ('%SQL Statistics%') AND [counter_name] IN ".
                          "('SQL Compilations/sec', 'SQL Re-Compilations/sec'))".
                        ")";
That ends my ability to troubleshoot lol
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests