So i’m using Grafana 8.4.4 with flux queries and InfluxDB 2.1.1 to track metrics from a Telegraf i’ve installed in a Windows Server. Basically i searched a lot, but i haven’t found any input plugin or any way to make a pannel that displays the type of OS or the version that has the machine with the Telegraf.
This may not sound very useful, but if you’re tracking info from a lot of clients with different types of machines and OS it would be pretty cool to have more context in a quick look.
If someone knows of an input plugin that does that, or how to send the data from a powershell command to an input, or how to make a custom input that can track the OS version, type, license or whatever, it would be very helpful.
To me the values were all tags, if you want to query the data you need a field hence the “field=1i”
This will run on the individual machine, you’ll need to run this on each machine OR if you’re in active directory you could use PowerShells Active Directory modules to connect to AD and get a list of your servers and go from there
If you’re running telegraf as a service and need to provide credentials to connect to AD then you should use PS built in Microsoft Secure String to store the credentials.
Side note on #3: those credentials can only be read by the user who sets them, so you would need to create an account for the service, log in to the windows machine, define your credentials and tell the service to use the new account. If you run this on each machine separately you shouldn’t need to do that. LOCAL SYSTEM will be sufficient. However if you do use a separate account you need to make sure it has permissions to access windows performance counters otherwise you will lose other windows data performance data.
The script itself: Can’t quite remember fully, it was a long time ago
Thank you for helping me with this, i haven’t changed the original hostname as it is another metric i use in other panels and queries, but i endend using a plugin that is very similar to execd, wich is the one that @philb has helped me with.
I don´t know what to say, im so thankful that you gave me that much help.
I investigated a lot these days about using inputs.exec, but i knew little more than how to correctly associate the powershell file to the telegraf config file.
With that script and your configuration it does work!
Influx collect the data correctly and display it as tags, but here comes one question wich i think you already try to solve me in number 1 on your list of things to consider;
Since influx display the data as tags, is there a way to display only the tag but not it’s value (since they lack of value) on a panel? Or maybe make the value from each tag to be its own name?
I think i’m making things harder but despite influx collects all the info i want, now i don’t know how to show it on a Grafana panel, because i think you cannot make a query to display just the name of a tag right?
However, did you show the data on Grafana too? and if so how did you?
·Edit: I was confusing the tag that shows the data with another tag called almost exactly the same that doesn´t work. I can show what i wanted, sorry if i confused you.
Thank you so much for everything.