Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Aug 22, 2017 5:48 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Install - Host template for MSSQL Server 2000 --> No dat
PostPosted: Fri Dec 09, 2011 5:43 am 
Offline

Joined: Thu Dec 08, 2011 5:44 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Install - Host template for MSSQL Server 2000 --> No dat
PostPosted: Fri Dec 09, 2011 8:28 am 
Offline
Cacti User

Joined: Thu Nov 08, 2007 2:00 pm
Posts: 107
Location: Ottawa, Canada
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


Top
 Profile  
 
 Post subject: Re: Install - Host template for MSSQL Server 2000 --> No dat
PostPosted: Thu Feb 23, 2017 5:45 pm 
Offline

Joined: Sun Jun 30, 2013 11:03 pm
Posts: 32
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:
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:
               /*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:
[email protected]:/home/xxxxx# php -q /usr/share/cacti/site/scripts/ss_win_mssql.php 192.168.2.1:1433 connections

[email protected]:/home/xxxxxx#


Top
 Profile  
 
 Post subject: Re: Install - Host template for MSSQL Server 2000 --> No dat
PostPosted: Thu Feb 23, 2017 6:49 pm 
Offline

Joined: Sun Jun 30, 2013 11:03 pm
Posts: 32
more info:

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


Code:
/*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:
#1 {main}
  thrown in file: /usr/share/cacti/site/scripts/ss_win_mssql.php on line: 44


Line 44:
Code:
                $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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group