-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No mem data on pfsense #3750
Comments
Log output: 2018-02-04T18:49:00Z E! Error in plugin [inputs.netstat]: error getting net connections info: exec: "lsof": executable file not found in $PATH |
This should work on freebsd, though I do not have a pfsense machine currently. Perhaps you can increase the amount of memory available by modifying a system setting? You might be able to get a better answer at the InfluxData Community site or from the pfsense community. |
FYI @danielnelson I am able to reproduce this issue on both a pristine installation of both FreeBSD-11.1-p8-RELEASE and pfSense-2.4.3 (11.1-p7-RELEASE). Both servers possess 4GB RAM. Telegraph 1.4x and 1.3x on these machines do not exhibit this |
So the problem is, that Telegraf is running on an old version? |
@darox I am not sure what is causing the issue. Telegraf 1.5x on 2x amd64 FreeBSD-11.1-RELEASE machines exhibit this Telegraf 1.4x and 1.3x on the same 2 machines, do not exhibit this issue; and I can query memory data points just fine. |
Can you test with the latest 1.6 release candidate? |
@danielnelson Finally got 1.6.0-rc3 built. Unfortunately I am still seeing the same issues on two machines (one is a pristine installation):
As a result, no |
Since you are setup to compile, can you try running this program: package main
import (
"fmt"
"github.com/shirou/gopsutil/mem"
)
func main() {
stats, err := mem.VirtualMemory()
if err != nil {
fmt.Println(err)
}
fmt.Println(stats)
} Just save it to your telegraf directory as |
Actually, digging deeper I wonder if this could have been fixed in diff --git a/Godeps b/Godeps
index 7c504a0b..0715fbd7 100644
--- a/Godeps
+++ b/Godeps
@@ -84,7 +84,7 @@ github.com/yuin/gopher-lua 66c871e454fcf10251c61bf8eff02d0978cae75a
github.com/zensqlmonitor/go-mssqldb ffe5510c6fa5e15e6d983210ab501c815b56b363
golang.org/x/crypto dc137beb6cce2043eb6b5f223ab8bf51c32459f4
golang.org/x/net f2499483f923065a842d38eb4c7f1927e6fc6e6d
-golang.org/x/sys 739734461d1c916b6c72a63d7efda2b27edb369f
+golang.org/x/sys 76c138986e66b22cbf82122ac886457fb5226957
golang.org/x/text 506f9d5c962f284575e88337e7d9296d27e729d3
gopkg.in/asn1-ber.v1 4e86f4367175e39f69d9358a5f17b4dda270378d
gopkg.in/fatih/pool.v2 6e328e67893eb46323ad06f0e92cb9536babbabc After you change this run:
|
@danielnelson Cool that's a good idea. Here's the output:
|
@danielnelson Gah must've replied at the same time. :) I will try that - thanks! |
@danielnelson no change with patching the |
What do you get when you run |
Maybe we need a Uint64? Try this out: package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
pageSize, err := unix.SysctlUint32("vm.stats.vm.v_page_size")
if err != nil {
fmt.Println(err)
} else {
fmt.Println(pageSize)
}
pageSize64, err := unix.SysctlUint64("vm.stats.vm.v_page_size")
if err != nil {
fmt.Println(err)
} else {
fmt.Println(pageSize64)
}
} |
Uint64:
|
I edited the program above (changed variable name of second pageSize to pageSize64). |
|
Oh, didn't expect the first command to work... what about this: package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
pageSize, err := unix.SysctlUint32("vm.stats.vm.v_page_size")
fmt.Printf("pageSize: %d %v\n", pageSize, err)
pageCount, err := unix.SysctlUint32("vm.stats.vm.v_page_count")
fmt.Printf("pageCount: %d %v\n", pageCount, err)
free, err := unix.SysctlUint32("vm.stats.vm.v_free_count")
fmt.Printf("free: %d %v\n", free, err)
active, err := unix.SysctlUint32("vm.stats.vm.v_active_count")
fmt.Printf("active: %d %v\n", active, err)
inactive, err := unix.SysctlUint32("vm.stats.vm.v_inactive_count")
fmt.Printf("inactive: %d %v\n", inactive, err)
cached, err := unix.SysctlUint32("vm.stats.vm.v_cache_count")
fmt.Printf("cached: %d %v\n", cached, err)
buffers, err := unix.SysctlUint32("vfs.bufspace")
fmt.Printf("buffers: %d %v\n", buffers, err)
wired, err := unix.SysctlUint32("vm.stats.vm.v_wire_count")
fmt.Printf("wired: %d %v\n", wired, err)
} |
|
I updated the program, this is the joy of programming :) |
@danielnelson Hahah indeed! We have some results now:
|
This is interesting, we get this error on vfs.bufspace but the call immediately afterwards is successful. How constrained is the memory on this system? Google tells me that it might be |
Memory is utilized well...
https://raw.githubusercontent.com/ocochard/myscripts/master/FreeBSD/freebsd-memory.sh output:
|
Is it always buffers that fails? Does anything change if it is the only item you collect?: package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
buffers, err := unix.SysctlUint32("vfs.bufspace")
fmt.Printf("buffers: %d %v\n", buffers, err)
} |
Always the buffer that fails. Using your program above, to collect it alone, also fails:
|
@danielnelson Both are amd64, FreeBSD-11.1-RELEASE. |
I just fired up a amd64 FreeBSD-11.1-RELEASE virtual machine and was unable to reproduce the error, does anything change if you run the program as root? |
Wow that's strange. One of these is a pristine installation, the other existing. Both throw the same package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
buffers, err := unix.SysctlUint32("vfs.bufspace")
fmt.Printf("buffers: %d %v\n", buffers, err)
} |
Couple more things I would be interested in seeing. First, try using func main() {
buffers, err := unix.SysctlUint64("vfs.bufspace")
fmt.Printf("buffers: %d %v\n", buffers, err)
} If that doesn't help, try this C program: #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/sysctl.h>
int main (int argc, char *argv[]) {
unsigned long oldp;
size_t oldp_size = 8;
if (sysctlbyname("vfs.bufspace", &oldp, &oldp_size, NULL, 0) != 0) {
perror("sysctlbyname");
return 1;
}
printf("%lu\n", oldp);
return 0;
} Run this like:
|
Output with
|
Nice, is that the same as |
I will bring in the update to gopsutil for the 1.7 release, but I'm not planning to do so at this time for 1.6 since it often introduces new issues. In the meantime you will need to compile a custom version to get this plugin working. |
@danielnelson makes perfect sense and I support that. I enjoyed working with you on this! |
Update: 1.6.0-rc4 does work as intended when gopsutil is compiled in using @danielnelson's pull req. Very nice work and thanks again for your efforts, and for putting this in the 1.7.0 milestone! |
@W0CHP Couldn't have figured it out without your help, really appreciate it. |
We noticed that the 2 fixes immediately after the gopsutil release we were using addressed issues in Telegraf, and so we decided to bring them into the 1.6 release branch. The fix for this issue will be available in the 1.6.1 release. |
@danielnelson Fantastic news! |
That would be amazing, I would love to get Telegraf into the official package repos for all the different platforms. |
@danielnelson FreeBSD indeed has the Both projects lag behind new Telegraf releases/fixes (the latter project being the worse of the two); which is where I come in... :-) I'm responsible for myriad UN*X machines, the orchestration and deployments of Telegraf to all of them, etc., as well as the TICK Stack instrumentation clusters monitoring everything. I need new versions as they're released kind of pronto, so I may as well keep submitting my changes to the project package maintainers; since part of my daily routine is tracking TICK Stack components for my deployment automation. have a wonderful weekend! 😃 |
Hi! I manage the telegraf port for FreeBSD and I update the telegraf port as soon as I get information about a new releas. Sadly, there is no esablished process for iinfluxdata to inform packagers like me informing me when a new version is about to be released. That would be a well needed process. How can such a relation be esablished? |
Hi @girgen! Thanks for committing my patches to Anyway... Have a great day! |
I think the method method is to watch for a release candidates using the github atom feed, we usually begin the rc process about 2 weeks before a minor version release I also try to keep the milestones updated to the expected release date. Let me know if this works. |
Sorry to hear about pfSense inactivity. I have no direct relation to pfSense, but perhaps you can ask on some general pfSense ports channel / forum / mailing list where other porters hang? I'll check out the github atom feed! |
@girgen I finally got their attention, and my pull request is in review. I will continue to work closely and hound the pfSense team, as it's FreeBSD-based, and is a very popular project. Pleasure working with you gentlemen! :-) |
I'm running telegraf on my pfsense to query data and send it to an influxdb, but for some reason the mem data is not available in influxdb.
Is this a known bug or is mem not supported on pfsense?
The text was updated successfully, but these errors were encountered: