Hi Sébastien,

This is indeed hard to troubleshoot: to further dig into this, we should
check if the expected system calls are invoked by the binary as expected.

I am assuming that you are using the Windows performance counters input
plugin and InfluxDB output plugin.

You will need to make use of PID debugger, e.g. Visual Studio Community (
https://beta.visualstudio.com/downloads/)

Following this guide
<https://msdn.microsoft.com/en-us/library/7a50syb3%28v=vs.110%29.aspx>  you
can attach to the running Telegraf process, select Memory Usage and enable
Heap Profiling. Take a couple snapshots of the Heap, select a snapshot and
go to "View Heap", then View Mode as "stacks view" and "Aggregate call
stack by: callee".

The system call issued by the Windows performance counters plugin is
"PdhCollectQueryData"
, while outputs.influxdb calls for a socket to establish the HTTP/S
connection.

If both calls are visible in the heap, that should mean that Telegraf is
actually working well enough to successfully reach out to the OS. If not,
it is encountering some internal error or being run with insufficient
privileges.


[image: Inline image 2]

Thanks,
Kostas

On Mon, Sep 5, 2016 at 7:57 PM, Sébastien Orban <[email protected]>
wrote:

>
>
> On Monday, September 5, 2016 at 6:10:19 PM UTC+2, [email protected]
> wrote:
>>
>> On Sunday, September 4, 2016 at 6:10:10 PM UTC+3, Sébastien Orban wrote:
>> > Hi,
>> >
>> >
>> > I'm having a lot of fun trying to build my monitoring solution, and on
>> Linux, MacOS X or with less fun stuff like SNMP it's working great. Still I
>> have an issue with a Windows Server 2012 install with the RC1 version :
>> nothing is sent if I run it as a service. Here's what I've tried :
>> >
>> >
>> > - Follow the instruction to install the service (so c:\program
>> files\Telegraf for exe/conf file), use the telegraf -service install ->
>> everything seem peachy, it's in the service list, the -config parameter is
>> right to the correct place and I'm happy.
>> > - configured and tested Telegraf - with -test and running "as is" on
>> the cli, even with -debug to be sure. Data are in the InfluxDB, so, it
>> works.
>> > - start the service and... nothing.
>> >
>> >
>> > I've search for an equivalent of the /var/log - of course there isn't,
>> and the Event log is showing me nothing.
>> >
>> >
>> > Next attempt : use NSSM. Telegraf start and seem to crash directly with
>> an Error 3 (in the event log), and then NSSM telling me that telegraf as
>> crashed "Service Telegraf ran for less than 1500 milliseconds. Restart will
>> be delayed by 16000 milliseconds."
>> >
>> >
>> > Any idea on how to move forward ? I feel stuck looking at a sealed
>> blackbox and it's not a pleasant feeling.
>> >
>> >
>> > Thanks in advance
>> >
>> >
>> > S. Orban
>>
>> Hi Sébastien,
>>
>> When run as a service the executable is started by the Service Control
>> Manager so there is no access to standard output or error.
>>
>> However I have not been able to reproduce this issue on my Windows Server
>> 2012 test machine, where telegraf runs as a service without issues.
>>
>> You can run the executable using any path in the config file parameter,
>> but after installing telegraf as a service with `telegraf.exe --service
>> install` ,  telegraf's config file path is hardcoded during service
>> registration.
>>
>> Thus it is not possible to use a config file from any location other than
>> "C:\Program Files\Telegraf\telegraf.conf".
>>
>>
>> Have you stored your telegraf config file under this path?
>
>
> Hi,
>
> Thanks for your time looking into it and yes, the file is at the correct
> place — I've checked again on Powershell, running 'notepad "C:\Program
> Files\Telegraf\telegraf.conf"' to be sure.
> And to be totally thorough I've just tried it again on an elevated cmd.exe
> prompt — same result.
>
> I don't know what to test further.
>
> Kind Regards,
>
> S. Orban
>



-- 
Konstantinos Botsas
Support Engineer
InfluxData

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALk5YvkfJQWNdb-T0i-QM%2BwnqbnmNG0eb%3DaA-jS5RqxX5D%2B3MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to