Downsampling: 1.8: you can have multiple retention per database. 2.0: one bucket , one retention. you need to downsample to a different bucket. Query: 1.8 : can only use FluxSQL 2.0: can use Flux and FluxSQL Continuous Query Continuous query is replaced with Task – you need to convert your InfluxSQL in Continuous query to Influx query and setup the task. Convert FLUXSQL to FLux query https://docs.influxdata.com/influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/ DownSampling data3 = from(bucket: “telegraf”) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => (r._measurement =~ /system.*/)) data3 |> aggregateWindow(fn: mean, every: 1h) |> filter(fn: (r) => (exists r._value)) |> to(bucket: “telegraf_30min”, org: “MyHomeInflux”) Sampling is easy, don’tRead More →

function do_curl_command($url,$headers,$post_data=false,$auth=””) { if(strpos($url,”http”)===false) { write_log(“Invalid curl url $url”); exit; } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_HEADER, 1); if($auth!=””) { curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $auth); //Your credentials goes here } $http_method=”GET”; write_log($post_data); if(is_array($post_data) || $post_data!=”” ) { if(is_array($post_data)) $post_data= http_build_query($post_data); else{ if(json_decode($post_data)) $headers[]=”Content-Type: application/json”; } curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); $http_method=”POST”; } curl_setopt($ch, CURLOPT_VERBOSE, false); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result=curl_exec($ch); if( $result === false) { echo ‘Curl error: ‘ . curl_error($ch); exit; } $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $headers = substr($result, 0, $header_size); $body = substr($result, $header_size); curl_close($ch); return array(“headers”=>$headers,”body”=>$body); } function write_log($data) { $ip=$_SERVER[“REMOTE_ADDR”]; $data=date(“\r\nY-m-dRead More →

<?php $filename=”hosts.txt”; if(!is_file($filename)) { echo “$filename not found”; exit; } foreach(file($filename) as $line) { $line =trim($line); if(strpos($line,”:”)===false) continue; list($host,$port)=explode(“:”,$line); $fp = @fsockopen($host, $port, $errno, $errstr, 30); $result=”GOOD”; if(!$fp) { $result=”BAD,$errstr($errno)”; } echo “$line,$result\n”; } ?>Read More →

The code below is to create filmstrip using Puppeteer const puppeteer = require(‘puppeteer’); (async () => { //const browser = await puppeteer.launch(); const browser = await puppeteer.launch({ args: [ ‘–no-sandbox’, ‘–disable-setuid-sandbox’ ] }); const page = await browser.newPage(); // Drag and drop this JSON file to the DevTools Performance panel! // Drag and drop this JSON file to the DevTools Performance panel! await page.tracing.start({ path: ‘/screenshots/profile.json’, screenshots: true }); await page.goto(‘https://www.google.com’); await page.tracing.stop(); await browser.close(); })();Read More →

## Splunk: Python 2 Add-ons for v8 Splunk is one of the most popular platforms for searching, monitoring, and analyzing machine data from websites, applications, and IT infrastructures. It is widely used for data analysis, monitoring, and troubleshooting across various industries. However, as technology progresses, the underlying software and its dependencies evolve as well. Splunk, like many other applications, has shifted its focus to Python 3, leaving older Python 2-based add-ons and custom scripts in a state of transition. In this article, we’ll explore the use of Python 2 add-ons in Splunk version 8 and what you need to know when working with them. ###Read More →

are primarily used as a relay to the actual influxdb. The free influx db does not provide the high availability function. We use influxdb-relay or influxdb-srelay as the relay to the actual influxdb. With this approach your data can be saved in multiple influxdb copies. That’s the main purpose, but here are some difference between them. Influxdb-relay : can support HTTP & UDP protocol . Only supports write operation, it does not support query. The destination backend set is fixed. Have a cache to store data when the backend is down temporarily. If the backend is down for too long, the cache will not beRead More →

The following script will replace all bad keywords with *** .  The keyword variable accepts multiple keywords, they must be separated with a comma (,) . $bad_keywords=”serial,hack,crack”; if($bad_keywords!=””) { $bad_keywords=str_replace(“,”,”)|(“,$bad_keywords); $bad_keywords=”/($bad_keywords)/i”; $filepath=preg_replace($bad_keywords, “****”, $filepath); }Read More →

# Splunk: Display All Metrics Info In today’s digital-first world, the need for real-time insights into the health, performance, and security of systems is paramount. As organizations scale their operations, the complexity of their infrastructure grows. This complexity requires tools that can provide clarity, break down data silos, and help in quickly identifying and resolving issues. One such powerful platform is **Splunk**, a leader in machine data analytics that allows users to search, monitor, and analyze large volumes of data from various sources. One of the key features of Splunk is its ability to process and display **metrics data**, which provides valuable insights into theRead More →

I have a Macbook pro with this symptom: it’s not powered on , tried to hold the power button for long time , still nothing happen. I tried with and without power adaptor, result is still the same. I open the laptop and disconnect the battery, connect the power adapter , it turns on and working perfectly. Is the battery bad? i connect the battery back, it’s working fine. But then i shut it down, i can’t turn it on back. what is the issue? it’s because the power key is dead. The power key is a part of keyboard system. Solution? there are 3Read More →

High CPU usage is a common issue in every system, finding the root cause is not always easy. What the sign of a high CPU usage? I normally look at load avg , if the load avg is higher than the number of your CPU cores , then your system is overloaded. I have 8 cores, so my number is good. Sometimes we our load avg does not reach to the cpu cores , but we still see some application is slow, it’s because there is a process occupies the one single CPU core. My next step will be check the CPU usage per processRead More →