#include "common.h"
#include "plugin.h"
#include "configfile.h"
+#include "utils_complain.h"
#include <pthread.h>
#include <netinet/in.h>
hostlist_t *hl;
int count;
+ c_complain_t complaint = C_COMPLAIN_INIT_STATIC;
+
pthread_mutex_lock (&ping_lock);
pingobj = ping_construct ();
while (ping_thread_loop > 0)
{
int status;
+ _Bool send_successful = 0;
if (gettimeofday (&tv_begin, NULL) < 0)
{
status = ping_send (pingobj);
if (status < 0)
{
- ERROR ("ping plugin: ping_send failed: %s", ping_get_error (pingobj));
- pthread_mutex_lock (&ping_lock);
- ping_thread_error = 1;
- break;
+ c_complain (LOG_ERR, &complaint, "ping plugin: ping_send failed: %s",
+ ping_get_error (pingobj));
+ }
+ else
+ {
+ c_release (LOG_NOTICE, &complaint, "ping plugin: ping_send succeeded.");
+ send_successful = 1;
}
pthread_mutex_lock (&ping_lock);
if (ping_thread_loop <= 0)
break;
- (void) ping_dispatch_all (pingobj);
+ if (send_successful)
+ (void) ping_dispatch_all (pingobj);
if (gettimeofday (&tv_end, NULL) < 0)
{