SQL Server 2005 Templates

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

Moderators: Developers, Moderators

Post Reply
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SQL Server 2005 Templates

Post by phalek »

AND you added /usr/bin/php to the front of it ... right ?

Mine is working just fine.

PHP 5.1.6
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: SQL Server 2005 Templates

Post by JJX »

Yes, I did a lot of test to make it working.
I change it back to the initial query.
Snap2.png
Snap2.png (30.48 KiB) Viewed 3898 times

Cacti logs report:
02/27/2013 05:00:02 PM - CMDPHP: Poller[0] Host[307] DS[4779] SERVER: /var/www/cacti/scripts/ss_win_mssql.php ss_win_mssql 192.168.0.15:53262 transactions cactistats 12345678901234567, output: U
02/27/2013 05:00:02 PM - CMDPHP: Poller[0] Host[307] DS[4779] WARNING: Result from SERVER not valid. Partial Result: U
After each change I rebuild poller cache, just to be sure.
cacti rulez!
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SQL Server 2005 Templates

Post by phalek »

Hm,

I changed the ss_win_mssql file a bit as I had some issues with the memcache part.

Maybe editing the file and changing the following lines to match your system helps you:

Code: Select all

function ss_win_mssql ($hostname, $cmd, $username = NULL, $password = NULL) {
        list($host, $port) = explode(':', $hostname);
        $port = '53262';
        $username = 'cactistats';
        $password = '12345678901234567';

        $ret = '';

#        $MCache_Host = 'localhost';
#        $MCache_Port = '11211';
#        $cachekey = 'ss_win_mssql:'.$host.'-'.$port;
#        $MemCache = new Memcache;
#        $MemCache->connect($MCache_Host, $MCache_Port);
#        if (! $vals = $MemCache->get($cachekey)){
....
#               $MemCache->set($cachekey, $vals, FALSE, 15);
#        }

Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: SQL Server 2005 Templates

Post by JJX »

Yes, I have also disabled memcache (for troubleshooting)!

http://docs.cacti.net/usertemplate:host ... :sqlserver -->
"I use MemCached to speed up the polling process so the code is setup to use it. If you choose not to, comment out (or delete) lines 24-29 and 72-73"

Also the parameters are correctly passed and run by cacti. After enabling DEBUG logs:
02/27/2013 05:30:02 PM - PHPSVR: Poller[0] DEBUG: PID[23952] CTR[5] INC: 'php' FUNC: '/var/www/cacti/scripts/ss_win_mssql.php' PARMS: 'ss_win_mssql 192.168.0.15:53262 logflushes cactistats 12345678901234567'
cacti rulez!
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: SQL Server 2005 Templates

Post by JJX »

After deleting all associated rrd files and retyping the "Data Input Methods" (without changing anything) some of the graphs start working! :o :o :o :o

Some other still are at "NaN" state.
cacti rulez!
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: SQL Server 2005 Templates

Post by JJX »

After a few hours graphs start working without changing anything! Great! :o :o :o
cacti rulez!
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SQL Server 2005 Templates

Post by phalek »

so you encountered a self-healing issue within Cacti ... ;-)
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Re: SQL Server 2005 Templates HAYELP!

Post by argon0 »

OK, Hayelp...

I've started using these scripts to monitor my SQL servers, starting with standalone SQL 2005&2008 servers - all works fine on them..

So I start to look at some of my clusters, which have their own challenges - as they don't respond to SNMP queries properly....

So I get past that problem (i.e. that no queries are being run at all as no snmp response is being received) - by getting rid of the SNMP community name from the host details screen.

I've run the script on the SQL server - fine - cactistats is a user with the correct password set up, but I don't get any graphs - in the logs I get the following:
02/28/2013 01:16:03 PM - PHPSVR: Poller[0] WARNING: Script Server terminated with signal 'SIGSEGV' in file:'ss_win_mssql.php', function:'ss_win_mssql', params:'HOSTNAMEOFCLUSTER: scans'
Any ideas gratefully accepted!
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SQL Server 2005 Templates

Post by phalek »

This may be an issue with FreeTDS, you should check if you can run the script from the command line. See some posts above for the syntax.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Re: SQL Server 2005 Templates

Post by argon0 »

Huh?

What is FreeTDS?
Also this script IS working with other SQL servers, just not with this one.

I am about to try it with another SQL Cluster....
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: SQL Server 2005 Templates

Post by phalek »

Are you using windows or linux to run Cacti ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Re: SQL Server 2005 Templates

Post by argon0 »

Linux, Centos, via CactiEZ, so 0.8.8a is the Cacti Version.

I added all the prereqs for the SQL monitoring, including MemCached, and the PHP bits....
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: SQL Server 2005 Templates

Post by JJX »

One minor mistake I think I found:

Windows - SQL Server - Connections --> "Minimum value" --> "GPRINT Type" should be Exact Number.
cacti rulez!
jjgarcial
Posts: 1
Joined: Mon Sep 27, 2010 3:56 pm

Re: SQL Server 2005 Templates

Post by jjgarcial »

Review config of sql in SQL Server Configuration Manager, confirm TCP Port in Protocols for instance of SQL (default MSSQLServer) in shape IP Addresses validate port for all IP's in your server (default 1433), if is necesary change any value, restart service. Work for my.
slefevre01
Posts: 1
Joined: Tue Sep 24, 2013 9:16 am

Re: SQL Server 2005 Templates

Post by slefevre01 »

Hello,
The script doesn't work for sql2012. someone has already studied the problem ?
thank
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests