- `charts.d.plugin` provides a simple way to script data collection in BASH. It includes example plugins that collect values from:
- `nut` (UPS load, frequency, voltage, etc)
- - `sensors` (read temperature, voltage, current, power, humidity, fans rotation sensors)
- - `cpufreq` (read current CPU clock frequency)
+ - `sensors` (temperature, voltage, current, power, humidity, fans rotation sensors)
+ - `cpufreq` (current CPU clock frequency)
- `postfix` (e-mail queue size)
- `squid` (web proxy statistics)
+ - `mysql` (mysql global statistics)
+
+ Of course, you can write your own using BASH scripting.
- netdata is a web server, supporting gzip compression
# If a group_name starts with a -, the dimension will be hidden (cpu chart only)
#
-compile: cc1 cc1plus as gcc ld make automake autoconf
+compile: cc1 cc1plus as gcc ld make automake autoconf git
rsync: rsync
media: mplayer vlc xine mediatomb omxplayer omxplayer.bin kodi kodi.bin xbmc xbmc.bin mediacenter eventlircd
squid: squid squid2 squid3
mail: dovecot imapd pop3d
postfix: master
nginx: nginx
+splunk: splunkd
+mongo: mongod
lighttpd: lighttpd
ftpd: proftpd in.tftpd
samba: smbd nmbd winbindd
w->client_port[NI_MAXSERV] = '\0';
switch(sadr->sa_family) {
+
case AF_INET:
debug(D_WEB_CLIENT_ACCESS, "%llu: New IPv4 web client from %s port %s on socket %d.", w->id, w->client_ip, w->client_port, w->ifd);
break;
+
case AF_INET6:
if(strncmp(w->client_ip, "::ffff:", 7) == 0) {
strcpy(w->client_ip, &w->client_ip[7]);
}
debug(D_WEB_CLIENT_ACCESS, "%llu: New IPv6 web client from %s port %s on socket %d.", w->id, w->client_ip, w->client_port, w->ifd);
break;
+
default:
debug(D_WEB_CLIENT_ACCESS, "%llu: New UNKNOWN web client from %s port %s on socket %d.", w->id, w->client_ip, w->client_port, w->ifd);
break;
}
w->data = web_buffer_create(INITIAL_WEB_DATA_LENGTH);
- if(!w->data) {
+ if(unlikely(!w->data)) {
+ // no need for error log - web_buffer_create already logged the error
close(w->ifd);
free(w);
return NULL;
char *content_type_string = "";
switch(w->data->contenttype) {
case CT_TEXT_HTML:
- content_type_string = "text/html";
+ content_type_string = "text/html; charset=utf-8";
break;
case CT_APPLICATION_XML:
- content_type_string = "application/xml";
+ content_type_string = "application/xml; charset=utf-8";
break;
case CT_APPLICATION_JSON:
- content_type_string = "application/json";
+ content_type_string = "application/json; charset=utf-8";
break;
case CT_APPLICATION_X_JAVASCRIPT:
- content_type_string = "application/x-javascript";
+ content_type_string = "application/x-javascript; charset=utf-8";
break;
case CT_TEXT_CSS:
- content_type_string = "text/css";
+ content_type_string = "text/css; charset=utf-8";
break;
case CT_TEXT_XML:
- content_type_string = "text/xml";
+ content_type_string = "text/xml; charset=utf-8";
break;
case CT_TEXT_XSL:
- content_type_string = "text/xsl";
+ content_type_string = "text/xsl; charset=utf-8";
break;
case CT_APPLICATION_OCTET_STREAM:
default:
case CT_TEXT_PLAIN:
- content_type_string = "text/plain";
+ content_type_string = "text/plain; charset=utf-8";
break;
}
// check for new incoming connections
if(FD_ISSET(listen_fd, &ifds)) {
w = web_client_create(listen_fd);
+ if(unlikely(!w)) {
+ // no need for error log - web_client_create already logged the error
+ continue;
+ }
if(pthread_create(&w->thread, NULL, web_client_main, w) != 0) {
error("%llu: failed to create new thread for web client.");