summaryrefslogtreecommitdiffstats
path: root/web/attachments/430613-check_fping.c_patch
blob: 4c661a8973d280d0b29d035136139835af5a026d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
68d67
< int alive_p = FALSE;
154,166d152
<   if (alive_p && strstr (buf, "avg, 0% loss)")){
<     rtastr = strstr (buf, "ms (");
<     rtastr = 1 + index (rtastr, '(');
<     rta = strtod (rtastr, NULL);
<     loss=strtod ("0",NULL);
<     die (STATE_OK,
<          _("FPING %s - %s (rta=%f ms)|%s %s\n"),
<          state_text (STATE_OK), server_name,rta,
<          perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100),
<          fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, TRUE, 0, FALSE, 0));
< 
<   }
< 
275c261
<     c = getopt_long (argc, argv, "+hVvaH:c:w:b:n:T:i:", longopts, &option);
---
>     c = getopt_long (argc, argv, "+hVvH:c:w:b:n:T:i:", longopts, &option);
292,294d277
<     case 'a':                 /* host alive mode */
<       alive_p = TRUE;
<       break;
436,438d418
<   printf (" %s\n", "-a");
<   printf ("    %s\n", _("Return OK after first successfull reply"));
<