Thursday, January 31, 2019

Python script for checking linux user account and password expiry


We create many local users in linux systems. If it is a production system, we usually set expiry dates for accounts and passwords. Usually we set these things and forget about this. And when application fails because of user or password expiry we think about it again. If would be great if we get some alert before user account or password expiry. Isn't it?

Wednesday, January 30, 2019

telnet python script using telnetlib


Daily we do a lot of stuff using telnet. Usually we log in to telnet using hostname and a port, then send actions and parameters and gets the response. We can do all these using an interactive terminal connection. Suppose we want to check something everyday and create an alert if something fails. In the post we will see how to check an Asterisk AMI Login using telnet actions and checking for errors. We will write a python script for automation and use this script with nagios to get alerts.