I recently upgraded my python to newer version and realized that my script to connect one Mongo DB server not working.Here are some of the steps that i did: Switch back to old version , it works Checking firewall logs, there is no logs Using telnet to open that port – i got connection refused error. What the heck? if the connection is refused, why my old python version works? This only happens to only one server only , other server is fine We use certificate to authenticate, i changed all certificate setting but it didn’t work. Is it my pymongo version? i downgraded pymongoRead More →

Upgrading my container image from PHP7 to PHP8.2.4 , all the ext library seems the same, but when my ldap_bind function failed on php8 .Warning: ldap_bind(): Unable to bind to server: Can’t contact LDAP server in This is the fix RUN apt-get update && apt-get install -y libldap-commonRead More →

I have some troubles with email sent from Splunk with some Alerts, debugging this takes a lot of time, i have to wait for the alert to trigger and check the log. Then i thought, is there anyway i can send mail immediately when i do a search instead of waiting for the alert triggered. Fortunately, the solution is already there : the sendemail command. * | top 5 host | sendemail to=”[email protected]” sendresults=true inline=true My thought: we just need to thing about a different way to do our daily routine, there will be a better way to do it.Read More →

I build a docker image, everything runs well on my dev machine. But when i deploy the images to my other machine, some services in the container was not able to start. The services starts by using /etc/init.d/script , when i troubleshoot the script i see the script stop at this command test -x $DAEMON && test -f /etc/postfix/main.cf || exit 0 Not sure what “test -x ” is , i google and found that : -x is the same as setting xtrace with the -o option to bash. So it gave me some hints to find where the root cause, it looks like we can’t run xtrace , iRead More →

When we configure inputs.exec , your program/bash script must have exit code 0. If it’s not 0 , telegraf will not send the metrics. This is an example , i have a bash file which will run 10 small scripts myscripts.sh /scripts/file1.sh/scripts/file2.sh/scripts/file3.sh/scripts/file9.sh/scripts/file10.sh Telegraf will run my scripts.sh , the last script file10.sh is very important, if this script does not exit 0 , the entire stack will not send any metrics. There is a trick , we can add exit 0 at the end of the myscripts.sh /scripts/file1.sh/scripts/file2.sh/scripts/file3.sh/scripts/file9.sh/scripts/file10.shexit 0Read More →

self.connection = cx_Oracle.connect( args.user, args.password, args.dsn) To fix this , create an environment TNS_ADMIN and save file sqlnet.ora , add these line to control the timeout SQLNET.OUTBOUND_CONNECT_TIMEOUT=10 ms import os os.environ[”TNS_ADMIN”] = “/script/tnsadmin” cx_Oracle.connect( args.user, args.password, args.dsn)Read More →

Cloudflare use several methods to detect if it’s a human or a bot:– SSL order – there is a different in the SSL library between a normal browser like Chrome with other tool like curl – – If the IP source comes from a data center or residential address– The user agentRead More →

ActiveMQ has 2 version: AciveMQ and (Apache or Redhat ActiveMQ) The configuration below is for Apache ActiveMQ [[inputs.jolokia2_agent]] urls = [ “http://localhost:8161/console/jolokia/” ] name_prefix = “activemq.” username = “artemis” password = “artemis” [[inputs.jolokia2_agent.metric]] name = “OperatingSystem” mbean = “java.lang:type=OperatingSystem” paths = [”ProcessCpuLoad”,”SystemLoadAverage”,”SystemCpuLoad”] [[inputs.jolokia2_agent.metric]] name = “jvm_runtime” mbean = “java.lang:type=Runtime” paths = [”Uptime”] [[inputs.jolokia2_agent.metric]] name = “jvm_memory” mbean = “java.lang:type=Memory” paths = [”HeapMemoryUsage”, “NonHeapMemoryUsage”, “ObjectPendingFinalizationCount”] [[inputs.jolokia2_agent.metric]] name = “jvm_garbage_collector” mbean = “java.lang:name=*,type=GarbageCollector” paths = [”CollectionTime”, “CollectionCount”] tag_keys = [”name”] [[inputs.jolokia2_agent.metric]] name = “jvm_memory_pool” mbean = “java.lang:name=*,type=MemoryPool” paths = [”Usage”, “PeakUsage”, “CollectionUsage”] tag_keys = [”name”] tag_prefix = “pool_” [[inputs.jolokia2_agent.metric]] name = “address” mbean = “org.apache.activemq.artemis:broker=\”*\”,component=addresses,address=\”*\”” paths =Read More →

curl -v https://www.google.com getaddrinfo() thread failed to start * Could not resolve host: www.google.com * Closing connection 0 Fix;– Adding seccomp=unconfined to your docker run commandor add this in your docker-compose security_opt:– seccomp:unconfinedRead More →