This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/expect -f | |
| # Run: openvpn-background-user-passwd.sh "username" password" | |
| set ovpn_user [lindex $argv 0] | |
| set ovpn_passwd [lindex $argv 1] | |
| spawn /sbin/openvpn --config /etc/openvpn/client.ovpn | |
| expect "Enter Auth Username:" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/ash | |
| help="Usage: zabbix_sender.sh <-z zabbix server> [-p server port] [-s host name] <-k key name> <-o key value>" | |
| while getopts "z:p:s:k:o:h" c; do | |
| case $c in | |
| z)z=${OPTARG};; | |
| p)p=${OPTARG};; | |
| s)s=${OPTARG};; | |
| k)k=${OPTARG};; | |
| o)o=${OPTARG};; | |
| h)echo $help;exit 0;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run this command in PowerShell | |
| # Set timezone | |
| %windir%\system32\tzutil.exe /s "Ekaterinburg Standard Time" | |
| # Disable IPv6 | |
| Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\services\TCPIP6\Parameters' -name "DisabledComponents" -Value 255; | |
| # Enable RDP | |
| Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE USER ZABBIXMON IDENTIFIED BY "zabbixmon" DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; | |
| GRANT CONNECT TO ZABBIXMON; | |
| GRANT RESOURCE TO ZABBIXMON; | |
| ALTER USER ZABBIXMON DEFAULT ROLE ALL; | |
| GRANT SELECT ANY TABLE TO ZABBIXMON; | |
| GRANT CREATE SESSION TO ZABBIXMON; | |
| GRANT SELECT ANY DICTIONARY TO ZABBIXMON; | |
| GRANT UNLIMITED TABLESPACE TO ZABBIXMON; | |
| GRANT SELECT ANY DICTIONARY TO ZABBIXMON; | |
| GRANT SELECT ON V_$SESSION TO ZABBIXMON; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $Profile = Get-NetConnectionProfile -InterfaceAlias "Ethernet 1" | |
| $Profile.NetworkCategory = "Private" | |
| Set-NetConnectionProfile -InputObject $Profile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| If you're running the Zabbix on CentOS 8 with SELinux enabled on it, then you must do all command on this section. | |
| Install SELinux utilities using the dnf command below. | |
| dnf install policycoreutils checkpolicy setroubleshoot-server | |
| Once the installation is complete, create a new directory '~/zabbix-linux' and go into it. | |
| mkdir -p ~/zabbix-selinux | |
| cd ~/zabbix-selinux/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get zabbix user id: | |
| SELECT u.userid FROM users u WHERE u.ALIAS='mgrigoriev'; | |
| # Cleaning filter on 'Problems' page: | |
| DELETE FROM profiles WHERE idx='web.problem.filter.show' AND idx2='0' AND userid='XXX'; | |
| DELETE FROM profiles WHERE idx='web.problem.filter.groupids' AND userid='XXX'; | |
| DELETE FROM profiles WHERE idx='web.problem.filter.hostids' AND userid='XXX'; | |
| DELETE FROM profiles WHERE idx='web.problem.filter.application' AND idx2='0' AND userid='XXX'; | |
| DELETE FROM profiles WHERE idx='web.problem.filter.triggerids' AND userid='XXX'; | |
| DELETE FROM profiles WHERE idx='web.problem.filter.problem' AND idx2='0' AND userid='XXX'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get zabbix user id: | |
| SELECT u.userid FROM users u WHERE u.ALIAS='mgrigoriev'; | |
| # Cleaning filter on 'Problems' page: | |
| DELETE FROM profiles WHERE idx='web.problem.filter.show' AND idx2='0' AND userid='XXX' | |
| DELETE FROM profiles WHERE idx='web.problem.filter.groupids' AND userid='XXX' | |
| DELETE FROM profiles WHERE idx='web.problem.filter.hostids' AND userid='XXX' | |
| DELETE FROM profiles WHERE idx='web.problem.filter.application' AND idx2='0' AND userid='XXX' | |
| DELETE FROM profiles WHERE idx='web.problem.filter.triggerids' AND userid='XXX' | |
| DELETE FROM profiles WHERE idx='web.problem.filter.name' AND idx2='0' AND userid='XXX' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Test | |
| # zabbix_agentd -t vfs.fs.mounted["/","rw"] | |
| # Return 1 if fs / is mounted rw mode, else return 0 | |
| UserParameter=vfs.fs.mounted[*],findmnt -nr -o source -T "$1" -O "$2" > /dev/null && echo 1 || echo 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UserParameter=systemd.service.discovery,sys_list=$(systemctl list-unit-files | grep ".service" | awk '{split($0,a,".service"); split($0,b," "); print "\"{#SERVICE}\":\""a[1]"\",\"{#STATE}\":\"" b[2]"\""}'); echo -n '['; for s in $sys_list; do echo -n "{"$s"},"; done | sed 's/.$//' ; echo -n ']' |