Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Monitor Windows via WMI from Cacti on Linux
Goto page Previous  1, 2, 3 ... 35, 36, 37, 38  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
garnser



Joined: 13 Jan 2010
Posts: 9

PostPosted: Mon Jan 18, 2010 7:53 am    Post subject: Reply with quote

So 0.0.6 worked fine on one of my hosts, I've tried on a second host now and it seams that there's issues creating the RRD files:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="vsrv1 - Disk I/O" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Operations Per Sec" \
--slope-mode \
--font TITLE:9: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/var/lib/cacti/rra/vsrv1_writespersec_1209.rrd":ReadsPersec:AVERAGE \
DEF:b="/var/lib/cacti/rra/vsrv1_writespersec_1209.rrd":WritesPersec:AVERAGE \
DEF:c="/var/lib/cacti/rra/vsrv1_writespersec_1209.rrd":QueueLength:AVERAGE \
CDEF:cdefa=b,8,* \
AREA:cdefa#BCBEB3FF:"Total\:" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:a#FF0000FF:"Read\:" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97FF:"Write\:" \
GPRINT:b:LAST:" Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:c#000000FF:"Queue Length\:" \
GPRINT:c:LAST:"Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: opening '/var/lib/cacti/rra/vsrv1_writespersec_1209.rrd': No such file or directory

As far as I can see all permissions are correct (regular snmp pollers works fine), please advice, the difference on this host is that I'm using spine instead.

If I run the rrdtool create manually as the user no errors appear:
www-data@mon:/var/lib/cacti/rra$ /usr/bin/rrdtool create \
> /var/lib/cacti/rra/vsrv1_writespersec_1210.rrd \
> --step 300 \
> DS:WritesPersec:COUNTER:600:0:500000 \
> DS:ReadsPersec:COUNTER:600:0:500000 \
> DS:QueueLength:GAUGE:600:0:10000 \
> DS:WriteBytesPersec:COUNTER:600:0:500000 \
> DS:ReadBytesPersec:COUNTER:600:0:500000 \
> RRA:AVERAGE:0.5:1:500 \
> RRA:AVERAGE:0.5:1:600 \
> RRA:AVERAGE:0.5:6:700 \
> RRA:AVERAGE:0.5:24:775 \
> RRA:AVERAGE:0.5:288:797 \
> RRA:MAX:0.5:1:500 \
> RRA:MAX:0.5:1:600 \
> RRA:MAX:0.5:6:700 \
> RRA:MAX:0.5:24:775 \
> RRA:MAX:0.5:288:797 \
>

www-data@mon:/var/lib/cacti/rra$ ls -ltra vsrv1_writespersec_1210.rrd
-rw-r--r-- 1 www-data www-data 276344 2010-01-18 14:11 vsrv1_writespersec_1210.rrd
www-data@mon:/var/lib/cacti/rra$

Update:
It seams that wmi does something nasty, for some reason I couldn't create any new graphs (got the same error) once I removed wmi it worked fine again.
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Mon Jan 18, 2010 7:29 pm    Post subject: Reply with quote

What do you mean something nasty? More information needed.

I'm not sure how you are having all these problems, it almost sounds like your cacti install itself isn't quite 100%. The RRD side of things is entirely handled by cacti. Really all my script is, is an interface between cacti (and what it expects as input/output) and the wmic binary. That and the templates.

If you have just swapped to spine make sure that the user spine runs as can actually read/write to the RRD files and also create files where the RRD files are stored. As from memory the RRD files are not generated until the first time they are polled.

But yer I'm not sure how those templates would cause *any* issue creating new graphs as they are purely templates. No actual code in cacti is touched.
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Tue Jan 19, 2010 9:03 am    Post subject: Reply with quote

to claymen:
for me now all works well I deploy slowly scripts and it's good !

Many thx for your work and the time passed to help us



For garnser:
if like me, you have many pb, restart from scratch, delete cacti directory if necessary and be sure that localhost script works well, then import just a template (memory usage for me) use only this one until it's working
PS: when rrd wasn't create it's a permission pb
PS2: Rebuild Poller Cache work's well !
good luck !

T
Back to top
lupick



Joined: 28 Nov 2006
Posts: 17

PostPosted: Thu Jan 21, 2010 12:06 pm    Post subject: Reply with quote

Dear All,

I've latest version of cacti running wmi template. I've a problem checing the Process Stats template

if I manually run this command to monitor ctfmon.exe:


/usr/bin/php -q /www/cacti/scripts/wmi.php -h 'MYHOST' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfRawData_PerfProc_Process' -n '' -k 'Name' -v 'ctfmon.exe' -c 'ThreadCount,HandleCount,PrivateBytes,VirtualBytes,PageFileBytes,PercentPrivilegedTime,PercentProcessorTime,PercentUserTime'

but I have no answare. I've tried different exe but no luck.
Do you have any idea??

thanks

L.
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Fri Jan 22, 2010 5:50 am    Post subject: Reply with quote

try with ctfmon (without .exe)

works for me

Edit
if the process run more than one time for exemple "explorer" who run for each user connected it's doen't work for me
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Fri Jan 22, 2010 6:47 am    Post subject: Reply with quote

Taltos wrote:
try with ctfmon (without .exe)

works for me

Edit
if the process run more than one time for exemple "explorer" who run for each user connected it's doen't work for me


That is correct, because when you have multiple instances of the same process running it will return multiple rows back. From memory you can't filter down per user on them but I really didn't need to as the process I needed to monitor only allowed a single instance per system.
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Sat Jan 23, 2010 2:55 pm    Post subject: Reply with quote

Cleymen could you try to help me again ?

I have 2pb wih 2 exchange grah


first:Active Client Logons doesn't work

Code:
RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="srvexch - Active Client Logons" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Logons" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
LINE1:#000000FF:"Total\:"  \
GPRINT::LAST:"    Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
LINE1:#FF0000FF:"Database5\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
LINE1:#0000FFFF:"Database4\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
LINE1:#FFAB00FF:"Database3\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
LINE1:#28CF21FF:"Database2\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
LINE1:#55009DFF:"Database1\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"

RRDTool Says:

[b]ERROR: parameter '#000000FF' does not represent a number in line LINE1:#000000FF:Total\:[/b]


I 'va try many template version without succes

thx for your opinion !
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Sat Jan 23, 2010 10:33 pm    Post subject: Reply with quote

The active client logons is one that you have to create as a templated graph then switch to no template so that you can edit. E.g. this is because there was no way to vary the number of databases shown dynamically in cacti.

As in it can't auto detect you have 6 databases and create a single graph to show them all with correct names. You kinda can with a data query but still.. So yes create the graph, then set it to no template so you can edit and then add in your data sources for each database you want to see active client logons and then name them if you wish.

But its one you have to do some manual work on.
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Mon Jan 25, 2010 4:14 am    Post subject: Reply with quote

Wonderfull !

so, my last pb (really) is for Total Mailbox Items.

graph say
Code:
"Nan"


RRDtools say:

Code:
      RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="srvexch - Total Mailbox Items" \
--base=1000 \
--height=120 \
--width=750 \
--alt-autoscale \
--units-exponent=2 \
--vertical-label="Items" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/srvexch_totalitems_179.rrd":TotalItems:AVERAGE \
AREA:a#FF000033:""  \
LINE1:a#FF0000FF:"Items\:"  \
GPRINT:a:MIN:"Minimum\:%8.0lf"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf"  \
GPRINT:a:MAX:"Maximum\:%8.0lf"

RRDTool Says:

OK



I think problem came from "Filter Value" in data source.

if I run
Code:
intranet:/tmp# wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT Name FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"

say
Code:
CLASS: Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox
Name
pgs1-Bal1
_Total


So I have put in filter Value pgs1-Bal1 oo 'pgs1-Bal1'
but it 'doesn't work

any ideas ?


thx (again)
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Mon Jan 25, 2010 9:03 am    Post subject: Reply with quote

What comes back if you do

wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT * FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Mon Jan 25, 2010 11:44 am    Post subject: Reply with quote

no errors:

Code:

intranet:/tmp# wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT * FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"
CLASS: Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox
ActiveClientLogons|AverageDeliveryTime
|Caption|CategorizationCount|ClientLogons|Description|FolderopensPersec|Frequency_Object|Frequency_PerfTime|Frequency_Sys100NS|
HTTPDAVCurrentPendingNotifications|HTTPDAVCurrentSubscriptions|HTTPDAVCurrentTransactionLocks
|HTTPDAVNotifyRequestsPersec|HTTPDAVTotalLocksCreated|HTTPDAVTotalNotifyRequests
|HTTPDAVTotalSubscriptionsCreated|HTTPDAVTotalSubscriptionsExpired|Localdeliveries
|Localdeliveryrate|LogonOperationsPersec|
MessageOpensPersec|MessageRecipientsDelivered|MessageRecipientsDeliveredPermin
|MessagesDelivered|MessagesDeliveredPermin|MessagesSent|MessagesSentPermin|MessagesSubmitted|MessagesSubmittedPermin|Name|PeakClientLogons|ReceiveQueueSize
|RestrictedViewCacheHitRate|RestrictedViewCacheMissRate
|SearchTaskRate|SendQueueSize|SingleInstanceRatio|SingleInstanceRatio_Base|SlowFindRowRate
|Timestamp_Object|Timestamp_PerfTime|Timestamp_Sys100NS
|TotalCountofRecoverableItems|TotalSizeofRecoverableItems
70|15655|(null)|4|105|(null)|19811|0|1595970000|10000000|0|0|0|0|0|0|6|6|569|569|1875|3870|572|1|569|1|237|0
|220|0|pgs1-Bal1|250|0|745|13|18
|0|154236|6427200|496|0|187444300778880|1174485114000|7068|1061180
70|15655|(null)|4|105|(null)|19811|0|1595970000|10000000|0|0|0|0|0|0|6|6|569|569|1875|3870|572|1|569|1|237|0|220|0|_Total|250|0|745|13|18|0|154236|6427200|496|0|187444300778880|1174485114000|7068|1061180
intranet:/tmp#




But If un run

Code:
/usr/bin/php -q /var/www/cacti/scripts/wmi.php -h '172.16.1.4' -u '/etc/cacti/cactiwmi.pw' -w 'Exchange_Mailbox' -n 'rootMicrosoftExchangeV2' -k 'MailboxDisplayName' -v 'pgs1-Bal1' -c 'Size,TotalItems,DeletedMessageSizeExtended'


(I'have found this commande in poller cache



Quote:
Return code non-zero, debug mode enabled!
/usr/local/bin/wmic --namespace='rootMicrosoftExchangeV2' --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT Size,TotalItems,DeletedMessageSizeExtended FROM Exchange_Mailbox WHERE MailboxDisplayName='pgs1-Bal1'" 2>/dev/null
Exec Status: 1
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Tue Jan 26, 2010 6:41 pm    Post subject: Reply with quote

It looks like these columns Size,TotalItems,DeletedMessageSizeExtended don't exist on your exchange server's WMI output. Is this exchange 2007 or 2003? I haven't tested that per mailbox query on a 2007 mailbox.
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Wed Jan 27, 2010 2:46 am    Post subject: Reply with quote

claymen wrote:
It looks like these columns Size,TotalItems,DeletedMessageSizeExtended don't exist on your exchange server's WMI output. Is this exchange 2007 or 2003? I haven't tested that per mailbox query on a 2007 mailbox.
*

it's exchange 2003
Back to top
claymen
Cacti User


Joined: 18 Aug 2008
Posts: 236
Location: Australia

PostPosted: Wed Jan 27, 2010 2:56 am    Post subject: Reply with quote

Hang on im confused.

On one spot your passing --namespace='rootMicrosoftExchangeV2' is it just the forum removing the \?

And earlier your querying a completely different class
wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT * FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"
CLASS: Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox

Which is it?

What happens when you query this?

/usr/local/bin/wmic --namespace='root\MicrosoftExchangeV2' --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT Size,TotalItems,DeletedMessageSizeExtended FROM Exchange_Mailbox WHERE MailboxDisplayName='pgs1-Bal1'"

If you run scriptomatic2 can you even pull data from that class from the MicrosoftExchangeV2 root?
Back to top
Taltos



Joined: 16 Dec 2009
Posts: 16

PostPosted: Wed Jan 27, 2010 6:45 am    Post subject: Reply with quote

claymen wrote:
Hang on im confused.

On one spot your passing --namespace='rootMicrosoftExchangeV2' is it just the forum removing the \?

And earlier your querying a completely different class
wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT * FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"
CLASS: Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox

Which is it?

Code:
intranet:/tmp# wmic -d0 --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT * FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox"
CLASS: Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox
ActiveClientLogons|AverageDeliveryTime|Caption|CategorizationCount|ClientLogons|Description
|FolderopensPersec|Frequency_Object|Frequency_PerfTime|Frequency_Sys100NS|HTTPDAVCurrentPendingNotifications|HTTPDAVCurrentSubscriptions|HTTPDAVCurrentTransactionLocks
|HTTPDAVNotifyRequestsPersec|HTTPDAVTotalLocksCreated|HTTPDAVTotalNotifyRequests|HTTPDAVTotalSubscriptionsCreated|HTTPDAVTotalSubscriptionsExpired|Localdeliveries
|Localdeliveryrate|LogonOperationsPersec|MessageOpensPersec|MessageRecipientsDelivered
|MessageRecipientsDeliveredPermin
|MessagesDelivered|MessagesDeliveredPermin|MessagesSent|MessagesSentPermin|MessagesSubmitted|MessagesSubmittedPermin|Name|PeakClientLogons|ReceiveQueueSize|RestrictedViewCacheHitRate
|RestrictedViewCacheMissRate|SearchTaskRate|SendQueueSize|SingleInstanceRatio|SingleInstanceRatio_Base|SlowFindRowRate|Timestamp_Object|Timestamp_PerfTime|Timestamp_Sys100NS
|TotalCountofRecoverableItems|TotalSizeofRecoverableItems
46|22123|(null)|4|177|(null)|42731|0|1595950000|10000000|0|0|0|0|0|0|6|6|890|890|2447|3294|892|3|890|3|274|3|267
|3|pgs1-Bal1|223|0|1205|16|31|0|155298|6508100|372|0|131378009194085|823196273000|7029|920720
46|22123|(null)|4|177|(null)|42731|0|1595950000|10000000|0|0|0|0|0|0|6|6|890|890|2447|3294|892|3|890|3|274|3|267|3
|_Total|223|0|1205|16|31|0|155298|6508100|372|0|131378009194085|823196273000|7029|920720












What happens when you query this?

/usr/local/bin/wmic --namespace='root\MicrosoftExchangeV2' --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT Size,TotalItems,DeletedMessageSizeExtended FROM Exchange_Mailbox WHERE MailboxDisplayName='pgs1-Bal1'"


Code:
intranet:/tmp# /usr/local/bin/wmic --namespace='root\MicrosoftExchangeV2' --authentication-file=/etc/cacti/cactiwmi.pw //172.16.1.4 "SELECT Size,TotalItems,DeletedMessageSizeExtended FROM Exchange_Mailbox WHERE MailboxDisplayName='pgs1-Bal1'"
(works 2sec then:)
intranet:/tmp#


If you run scriptomatic2 can you even pull data from that class from the MicrosoftExchangeV2 root?



requete.jpg
 Description:
result query scriptomatic
 Filesize:  50.65 KB
 Viewed:  759 Time(s)

requete.jpg



scriptomaticv2.jpg
 Description:
scriptomatic
 Filesize:  111.76 KB
 Viewed:  759 Time(s)

scriptomaticv2.jpg


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3 ... 35, 36, 37, 38  Next
Page 36 of 38

 



Powered by phpBB © 2001, 2005 phpBB Group