mirror of
https://github.com/maride/afl-prom.git
synced 2024-11-14 00:44:25 +00:00
32 lines
553 B
Go
32 lines
553 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
)
|
|
|
|
// Main function
|
|
func main() {
|
|
// Register flags
|
|
registerWatcherFlags()
|
|
flag.Parse()
|
|
|
|
// Check args
|
|
targetFuzzers, targetErr := getFuzzersToWatch()
|
|
if targetErr != nil {
|
|
log.Println(targetErr.Error())
|
|
return
|
|
}
|
|
|
|
// Start thread to watch the fuzzer(s)
|
|
registerFuzzers(targetFuzzers)
|
|
go watchFuzzers()
|
|
|
|
// Start HTTP handler exposing the metrics
|
|
http.Handle("/metrics", promhttp.Handler())
|
|
http.ListenAndServe(":2112", nil)
|
|
}
|