diff --git a/rrd_c.go b/rrd_c.go index f4bdaf3..806ca75 100644 --- a/rrd_c.go +++ b/rrd_c.go @@ -443,7 +443,12 @@ func Info(filename string) (map[string]interface{}, error) { } // Fetch retrieves data from RRD file. -func Fetch(filename, cf string, start, end time.Time, step time.Duration, daemon *string) (FetchResult, error) { +func Fetch(filename, cf string, start, end time.Time, step time.Duration) (FetchResult, error) { + return DaemonFetch(filename, cf, start, end, step, nil) +} + +// DaemonFetch retrieves data from RRD file or the RRD daemon. +func DaemonFetch(filename, cf string, start, end time.Time, step time.Duration, daemon *string) (FetchResult, error) { fn := C.CString(filename) defer freeCString(fn) cCf := C.CString(cf) diff --git a/rrd_test.go b/rrd_test.go index d453583..3efc8c9 100644 --- a/rrd_test.go +++ b/rrd_test.go @@ -95,7 +95,7 @@ func TestAll(t *testing.T) { fmt.Printf("Start: %s\n", start) fmt.Printf("End: %s\n", end) fmt.Printf("Step: %s\n", step*time.Second) - fetchRes, err := Fetch(dbfile, "AVERAGE", start, end, step*time.Second, nil) + fetchRes, err := Fetch(dbfile, "AVERAGE", start, end, step*time.Second) if err != nil { t.Fatal(err) }