# df -k|awk {'print $3'}|grep -v used|grep -v ^0|awk '{ sum+=$1 } END {print sum/1024/1024 "G"}'
martes, 21 de enero de 2014
Sumatoria de Espacio Usado de Todos los Filesystems
Instalando RALUS en CentOS 5.4 (Symantec Backup Exec Agent for Linux 14.0.1798)
Descargamos el cliente para linux: RALUS_RMALS_RAMS-1798.17.tar.gz
Descomprimimos y destareamos:
Accedemos a la carpeta y verificamos que exista el installralus y instalamos:
Symantec Backup Exec Agent for Linux 14.0.1798
Enter the system names separated by spaces on which to install RALUS: (LinuxServer)
Checking system communication:
Checking OS version on LinuxServer ......................................................... Linux 2.6.18-164.el5
Checking system support for LinuxServer ................................. Linux 2.6.18-164.el5 supported by RALUS
Initial system check completed successfully.
Press [Return] to continue: ENTER
installralus will install the following RALUS packages on Linux target system: LinuxServer
VRTSralus Symantec Backup Exec Agent for Linux
Press [Return] to continue: ENTER
Checking system installation requirements:
Checking RALUS installation requirements on Linux target systems: LinuxServer
Checking RALUS installation requirements on LinuxServer:
Checking file system space ..................................................................... required space is available
Installation requirements checks completed successfully.
Press [Return] to continue: ENTER
Checking for port 10000 ............................................................................................... Done
Agent and Backup Exec server Configuration
Enter the names or IP addresses of the Backup Exec servers that you want the agent on 'LinuxServer' to communicate with.
An IP Address: XXX.XXX.XXX.XXX
A Host Name: COMPUTERNAME
Enter a directory host:
Enter the names or IP addresses of the Backup Exec servers that you want the agent on 'LinuxServer' to communicate with.
An IP Address: XXX.XXX.XXX.XXX
A Host Name: COMPUTERNAME
Enter a directory host: Ip_Del_Server_De_Backup_Exec
Do you want to add another name or address for this agent? [y, n] (n) ENTER
Hostnames and/or IP addresses verification for 'LinuxServer':
Address: Ip_Del_Server_De_Backup_Exec
Is this information correct? [y, n] (y) ENTER
To perform backups, you must have a 'beoper' user group configured with root account priviledges on the system. The 'beoper' user group can be created on all systems except NIS Servers.
After pressing [Return], the system 'LinuxServer' will be scanned to detect a 'beoper' user group with root account privileges. It will also scan for a NIS server.
Press [Return] to continue: ENTER
Checking for NIS server: ............................................................................................... No
Checking for 'beoper' user group: ................................................................................ Not Found
Checking for 'root' user membership in 'beoper' user group: ...................................................... Not Found
You can create 'beoper' user group manually or you can choose to have it created automatically.
Do you want installer to create 'beoper' user group on 'LinuxServer'? [y, n] (y) ENTER
Do you want to use specific group ID when creating 'beoper' user group? [y, n] (n) ENTER
Creating group 'beoper': .............................................................................................. Done
Do you want to add the 'root' user to 'beoper' user group? [y, n] (y) ENTER
Adding 'root' user to 'beoper' user group: ........................................................................... Done
Press [Return] to continue: ENTER
Checking Symantec Backup Exec Agent for Linux on LinuxServer:
Checking VRTSralus package
Installing VRTSralus 14.0.1798 on LinuxServer
................................................. done 1 of 1 steps
Symantec Backup Exec Agent for Linux installation completed successfully.
Press [Return] to continue: Copying new initialization scripts .................................................................................... Done
Updating files for beoper group ....................................................................................... Done
Installing SymSnap driver ........................................................................................... Failed
Symantec Backup Exec Agent for Linux 14.0.1798
Configuring Symantec Backup Exec Agent for Linux:
Creating configuration files on LinuxServer ................................................................ Done
The agent installer can automatically start the agent after the installation completes. Do you want to automatically start the agent on 'LinuxServer'? [y, n] (y) ENTER
Starting agent on LinuxServer .............................................................................. Done
To establish a trust between the Backup Exec server and the agent, move to the Backup Exec server and add the agent computer to the list of servers.
To add the agent computer, click Add on the Backup and Restore tab.
Symantec Backup Exec Agent for Linux configured successfully.
Press [Return] to continue: ENTER
The response file is saved at:
/var/tmp/vxif/installralus121105902/installralus121105902.response
The installralus log is saved at:
/var/tmp/vxif/installralus121105902/installralus.log
Vemos que esté corriendo el VRTSralus:
Ahora agregamos el cliente en el Backup Exec:
Agregar:
Seleccionamos "Equipo Linux", Siguiente:
Descomprimimos y destareamos:
# tar xzvf RALUS_RMALS_RAMS-1798.17.tar.gz
...
...
VxIF/NativePerl/Net/SocketCmd.pm
VxIF/NativePerl/PerlUnixSh.pm
VxIF/NativePerl/PerlUnixCmds.pm
#
Accedemos a la carpeta y verificamos que exista el installralus y instalamos:
# cd RALUS64/
# ls -l
total 28
-rwxr-xr-x 1 10001 110 634 Nov 8 2011 installralus
-rwxr-xr-x 1 10001 110 623 Nov 8 2011 installrmal
drwxr-xr-x 3 10001 110 4096 Jan 26 2012 pkgs
-rwxr-xr-x 1 10001 110 226 Jan 26 2012 ralusinst.conf
-rwxr-xr-x 1 10001 110 257 Jan 26 2012 rmalinst.conf
-rwxr-xr-x 1 10001 110 567 Nov 8 2011 uninstallralus
-rwxr-xr-x 1 10001 110 566 Nov 8 2011 uninstallrmal
# ./installralus
Symantec Backup Exec Agent for Linux 14.0.1798
Enter the system names separated by spaces on which to install RALUS: (LinuxServer)
Checking system communication:
Checking OS version on LinuxServer ......................................................... Linux 2.6.18-164.el5
Checking system support for LinuxServer ................................. Linux 2.6.18-164.el5 supported by RALUS
Initial system check completed successfully.
Press [Return] to continue: ENTER
installralus will install the following RALUS packages on Linux target system: LinuxServer
VRTSralus Symantec Backup Exec Agent for Linux
Press [Return] to continue: ENTER
Checking system installation requirements:
Checking RALUS installation requirements on Linux target systems: LinuxServer
Checking RALUS installation requirements on LinuxServer:
Checking file system space ..................................................................... required space is available
Installation requirements checks completed successfully.
Press [Return] to continue: ENTER
Checking for port 10000 ............................................................................................... Done
Agent and Backup Exec server Configuration
Enter the names or IP addresses of the Backup Exec servers that you want the agent on 'LinuxServer' to communicate with.
An IP Address: XXX.XXX.XXX.XXX
A Host Name: COMPUTERNAME
Enter a directory host:
Enter the names or IP addresses of the Backup Exec servers that you want the agent on 'LinuxServer' to communicate with.
An IP Address: XXX.XXX.XXX.XXX
A Host Name: COMPUTERNAME
Enter a directory host: Ip_Del_Server_De_Backup_Exec
Do you want to add another name or address for this agent? [y, n] (n) ENTER
Hostnames and/or IP addresses verification for 'LinuxServer':
Address: Ip_Del_Server_De_Backup_Exec
Is this information correct? [y, n] (y) ENTER
To perform backups, you must have a 'beoper' user group configured with root account priviledges on the system. The 'beoper' user group can be created on all systems except NIS Servers.
After pressing [Return], the system 'LinuxServer' will be scanned to detect a 'beoper' user group with root account privileges. It will also scan for a NIS server.
Press [Return] to continue: ENTER
Checking for NIS server: ............................................................................................... No
Checking for 'beoper' user group: ................................................................................ Not Found
Checking for 'root' user membership in 'beoper' user group: ...................................................... Not Found
You can create 'beoper' user group manually or you can choose to have it created automatically.
Do you want installer to create 'beoper' user group on 'LinuxServer'? [y, n] (y) ENTER
Do you want to use specific group ID when creating 'beoper' user group? [y, n] (n) ENTER
Creating group 'beoper': .............................................................................................. Done
Do you want to add the 'root' user to 'beoper' user group? [y, n] (y) ENTER
Adding 'root' user to 'beoper' user group: ........................................................................... Done
Press [Return] to continue: ENTER
Checking Symantec Backup Exec Agent for Linux on LinuxServer:
Checking VRTSralus package
Installing VRTSralus 14.0.1798 on LinuxServer
................................................. done 1 of 1 steps
Symantec Backup Exec Agent for Linux installation completed successfully.
Press [Return] to continue: Copying new initialization scripts .................................................................................... Done
Updating files for beoper group ....................................................................................... Done
Installing SymSnap driver ........................................................................................... Failed
Symantec Backup Exec Agent for Linux 14.0.1798
Configuring Symantec Backup Exec Agent for Linux:
Creating configuration files on LinuxServer ................................................................ Done
The agent installer can automatically start the agent after the installation completes. Do you want to automatically start the agent on 'LinuxServer'? [y, n] (y) ENTER
Starting agent on LinuxServer .............................................................................. Done
To establish a trust between the Backup Exec server and the agent, move to the Backup Exec server and add the agent computer to the list of servers.
To add the agent computer, click Add on the Backup and Restore tab.
Symantec Backup Exec Agent for Linux configured successfully.
Press [Return] to continue: ENTER
The response file is saved at:
/var/tmp/vxif/installralus121105902/installralus121105902.response
The installralus log is saved at:
/var/tmp/vxif/installralus121105902/installralus.log
Vemos que esté corriendo el VRTSralus:
# ps -efa |grep ralus
root 12651 1 0 11:10 pts/0 00:00:00 /opt/VRTSralus/bin/beremote
root 13733 3152 0 11:22 pts/0 00:00:00 grep ralus
#
Ahora agregamos el cliente en el Backup Exec:
Agregar:
Seleccionamos "Equipo Linux", Siguiente:
Tildamos el para establecer relación de confianza, Siguiente:
Agregamos el hostname ó la ip del Servidor Linux, Agregar:
Vemos que aparece abajo y Siguiente:
Agregamos las credenciales de root:
Agregar:
Cambiamos la contraseña, tildamos cuenta restringida:
Agregamos, confirmamos la password y damos aceptar a todas las ventanas:
Finalizar:
Esperamos unos segundos:
Y listo, ya lo vemos en la consola del Backup Exec:
miércoles, 15 de enero de 2014
Cobol Error invoking unauthorized copy of runtime. Multi-user server disallowed (Loc 828)
Problema: Está instalado un runtime de cobol con una misma licencia en más de un equipo en una misma red.
Solución: Colocar los servidores en redes distintas ó bloquear todo tipo de tráfico entre servidores que tengan la misma licencia instalada.
Puede realizar en un linux con iptables ó en solaris con ipf.
En Linux les dejo ejemplos de iptables en esta entrada: http://www.redes-seguridad.com.ar/2007/10/filtrar-ping-con-iptables-desde-todas.html
Para Solaris les dejo este otro ejemplo: http://www.redes-seguridad.com.ar/2014/01/firewall-en-solaris-10-ipfilter.html
Solución: Colocar los servidores en redes distintas ó bloquear todo tipo de tráfico entre servidores que tengan la misma licencia instalada.
Puede realizar en un linux con iptables ó en solaris con ipf.
En Linux les dejo ejemplos de iptables en esta entrada: http://www.redes-seguridad.com.ar/2007/10/filtrar-ping-con-iptables-desde-todas.html
Para Solaris les dejo este otro ejemplo: http://www.redes-seguridad.com.ar/2014/01/firewall-en-solaris-10-ipfilter.html
Firewall en Solaris 10 (ipfilter)
Vemos que el servicio de ipfilter está bajo:
Colocamos dentro del archivo lo que deseamos bloquear, en mi caso todas las conexiones icmp, tcp y udp desde el server local donde corremos las reglas al remote_server (debe estar la ip en el /etc/hosts)
Verificamos que esté online:
Probamos hacer un telnet, ssh, ping, etc al equipo remoto y vemos que no recibimos respuesta.
NOTA: Tener en cuenta cuando reiniciamos ó habilitamos el servicio ver que no tire ningún error el log:
# svcs -a |grep filter
offline 12:12:30 svc:/network/ipfilter:default
Editamos el archivo de configuración:
# vi /etc/ipf/ipf.conf
Colocamos dentro del archivo lo que deseamos bloquear, en mi caso todas las conexiones icmp, tcp y udp desde el server local donde corremos las reglas al remote_server (debe estar la ip en el /etc/hosts)
block return-rst out proto icmp from any to remote_server
block return-rst out proto tcp/udp from any to remote_server
Habilitamos el servicio de ipfilter:
# svcadm restart svc:/network/ipfilter:default
Verificamos que esté online:
# svcs -a |grep filteronline 12:12:30 svc:/network/ipfilter:default
Probamos hacer un telnet, ssh, ping, etc al equipo remoto y vemos que no recibimos respuesta.
NOTA: Tener en cuenta cuando reiniciamos ó habilitamos el servicio ver que no tire ningún error el log:
# tail -f /var/svc/log/network-ipfilter:default.log
[ Jan 15 12:12:30 Stopping because service restarting. ]
[ Jan 15 12:12:30 Executing stop method ("/lib/svc/method/ipfilter stop") ]
[ Jan 15 12:12:30 Method "stop" exited with status 0 ]
[ Jan 15 12:12:30 Executing start method ("/lib/svc/method/ipfilter start") ]
[ Jan 15 12:12:30 Method "start" exited with status 0 ]
jueves, 9 de enero de 2014
Logins erroneos en Windows Event Viewer
Inicio -> Ejecutar y tipeamos gpedit.msc
Local Computer Policy -> Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Audit Policy.
Sobre el panel derecho clickeamos sobre "Audit logon events":
En la solapa "Local Security Setting" tildamos "Success" y "Failure":
Probamos conectarnos al servidor con un password incorrecto y nos aparecerá "Failure Audit" en la solapa Security del Visor de Eventos, como muestra el cuadro en rojo:
viernes, 3 de enero de 2014
Chequear Visor de Sucesos Windows con Nagios
Descargué el script check_wmi_eventid de:
http://exchange.nagios.org/directory/Plugins/Operating-Systems/Windows/WMI/Check-eventlog-2Feventid-by-WMI/detailsDamos permisos de ejecución al script:
# chmod a+x ./check_wmi_eventid
Lo ejecutamos sin parámetros para ver la ayuda:
# ./check_wmi_eventid
usage: ./check_wmi_eventid options
check_wmi_eventid is a script to check windows event log , for a certian eventid..
Simple example : check application log , for eventtype error(-t) and eventid 9003(-e) with in the last 60 mins(-m60),
set warning (-w) if greater than 1 ,and set error(-c) if greater than 3
check_wmi_eventid -H 172.10.10.10 -u domain/user -p password -l application -e 9003 -w 1 -c 3 -t1 -m60
Adv. example : same as above , but with arguments -O -W -C, these are custom plugin output for OK,Warning and Critical
Marco ITEMCOUNt,LASTSTR , can be used!!
check_wmi_eventid -H 172.10.10.10 -u domain/user -p password -l application -e 9003 -w 1 -c 3 -t1 -m60 -O "Every thing is OK"
-W "Warning : something is not right" -C "It is totaly bad , found ITEMCOUNT events"
Try it out :)
If you find any error , please let me know
OPTIONS:
-h Show this message
-H Host/Ip
-u Domain/user
-p password
-l Name of the log eg "System" or "Application" or any other Event log as shown in the Windows "Event Viewer".
-t Eventtype: # 1=error , 2=warning , 3=Information,4=Security Audit Success,5=Security Audit Failure
-e Eventid
-s Sting search for string in message
-m Number of past min to check for events.
-w Warning
-W Custom waring string - ITEMCOUNT,LASTSTR marco can be used ex. -W "ITEMCOUNT Wanings with in the LASTSTR"
-c Critical
-C Custom critical string - ITEMCOUNT,LASTSTR marco can be used ex. -W "ITEMCOUNT Critical with in the LASTSTR"
-O Custom ok sting - ITEMCOUNT,LASTSTR marco can be used ex. -W "Everything ok with in the LASTSTR"
-U CUstom unknown string - ITEMCOUNT,LASTSTR marco can be used ex. -W "ITEMCOUNT Unknowns with in the LASTSTR"
-d Debug
-v Version
Eligiendo los parámetros, ejecuté lo siguiente y me aparecía que no encontraba el cliente de WMI (wmic)
# ./check_wmi_eventid -H hostname -u administrator -p password -l application -e 9003 -w 1 -c 3 -t1 -m60
WMIC ERROR : ./check_wmi_eventid: line 252: /bin/wmic: No such file or directory
Descargamos WMIC del siguiente enlace:
http://sourceforge.net/projects/pandora/files/Tools%20and%20dependencies%20%28All%20versions%29/RPM%20CentOS%2C%20RHEL/wmic-4.0.0SVN-2.1.el5.centos.noarch.rpm/download
Lo instalamos con rpm:
# rpm -hiv wmic-4.0.0SVN-2.1.el5.centos.noarch.rpm
warning: wmic-4.0.0SVN-2.1.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 155987ef
Preparing... ########################################### [100%]
1:wmic ########################################### [100%]
Lo ejecutamos si parámetros para ver los parametros requeridos:
# wmic
Usage: [-?] [-?] [-?] [-?NP] [-?NPV] [-?|--help] [--usage] [-d|--debuglevel DEBUGLEVEL]
[--debug-stderr] [-s|--configfile CONFIGFILE] [--option=name=value]
[-l|--log-basename LOGFILEBASE] [--leak-report] [--leak-report-full]
[-R|--name-resolve NAME-RESOLVE-ORDER]
[-O|--socket-options SOCKETOPTIONS] [-n|--netbiosname NETBIOSNAME]
[-S|--signing on|off|required] [-W|--workgroup WORKGROUP]
[--realm=REALM] [-i|--scope SCOPE] [-m|--maxprotocol MAXPROTOCOL]
[-U|--user [DOMAIN/]USERNAME[%PASSWORD]] [-N|--no-pass]
[--password=STRING] [-A|--authentication-file FILE] [-P|--machine-pass]
[--simple-bind-dn=STRING] [-k|--kerberos STRING] [-V|--version]
[--namespace=STRING]
//host query
Example: wmic -U [domain/]adminuser%password //host "select * from Win32_ComputerSystem"
Una vez instalado al querer ejecutar nuevamente el comando, nos tiraba error que no lo encontraba:
# ./check_wmi_eventid -H hostname -u administrator -p password -l application -e 9003 -w 1 -c 3 -t1 -m60
WMIC ERROR : ./check_wmi_eventid: line 252: /bin/wmic: No such file or directory
Viendo donde fue instalado, vemos que no encontraba la ruta:
# which wmic
/usr/bin/wmic
Editamos el script que descargamos (check_wmi_eventid):
# vim check_wmi_eventid
Cambiar:
WMIC=/bin/wmic
Por:
WMIC=/usr/bin/wmic
Ahora ejecutando el comando nuevamente, todo me devolvía el mismo valor, siempre era = 12:
# ./check_wmi_eventid -H server_name-u administrator -p password -l application -e 9003 -w 20 -c 30 -t1 -m60
OK 12 with Severity Level Error in application with in the last 1 hour|eventid9003=12;20;30;;
# ./check_wmi_eventid -H server_name-u administrator -p password -l security -e 4625 -w 20 -c 30 -t1 -m60
OK 12 with Severity Level Error in application with in the last 1 hour|eventid9003=12;20;30;;
Entonces decidí hacer mi propio script con WMIC, con el siguiente comando (cambiando las variables en rojo por los valores correspondientes):
# wmic -U USUARIO%PASWORD //HOSTNAME "select EventCode,EventIdentifier,EventType,TimeGenerated from Win32_NTLogEvent"
Obtenía algo como lo siguiente:
CLASS: Win32_NTLogEvent
EventCode|EventIdentifier|EventType|Logfile|RecordNumber|TimeGenerated
.....
.....
902|1073742726|0|Application|4506|20100615130231.000000-000
5615|3221231087|0|Application|4507|20100615130239.000000-000
5617|3221231089|0|Application|4508|20100615130243.000000-000
34|1073872930|3|Application|4509|20100615130247.000000-000
4|1073872900|3|Application|4510|20100615130250.000000-000
5|1073872901|3|Application|4511|20100615130251.000000-000
5|1073872901|3|Application|4512|20100615130251.000000-000
5|1073872901|3|Application|4513|20100615130251.000000-000
5|1073872901|3|Application|4514|20100615130251.000000-000
5|1073872901|3|Application|4515|20100615130251.000000-000
5|1073872901|3|Application|4516|20100615130251.000000-000
5|1073872901|3|Application|4517|20100615130251.000000-000
5|1073872901|3|Application|4518|20100615130251.000000-000
5|1073872901|3|Application|4519|20100615130251.000000-000
5|1073872901|3|Application|4520|20100615130251.000000-000
5|1073872901|3|Application|4521|20100615130251.000000-000
34|1073872930|3|Application|4522|20100615130251.000000-000
34|1073872930|3|Application|4523|20100615130251.000000-000
.....
Modificando un poco la query que hacía al server por WMI llegué a obtener todos los Eventos del visor de sucesos de un windows que tuvieran id=4625 (loguin erroneo) del registro de seguridad:
# wmic -U USUARIO%PASSWORD //HOSTNAME "select EventCode,EventIdentifier,EventType,TimeGenerated from Win32_NTLogEvent where EventCode='4625' AND Logfile='security'"
Pero yo en nagios quería monitorear los loguins erroneos del día actual, entonces quedó así:
#HOY=`date +%d/%m/%Y`
# wmic -U USUARIO%USUARIO //HOSTNAME "select EventCode,EventIdentifier,EventType,TimeGenerated from Win32_NTLogEvent where EventCode='4625' AND Logfile='security' AND TimeGenerated>='$HOY'"
Inicialmente la consulta comenzaba pero se cortaba, así que borré el visor de sucesos de seguridad de windows e hice un par de logueos erroneos para que aparezcan y aparecieron correctamente:
CLASS: Win32_NTLogEvent
EventCode|EventIdentifier|EventType|Logfile|RecordNumber|TimeGenerated
4625|4625|5|Security|2774019|20140103151300.184621-000
4625|4625|5|Security|2774020|20140103151325.320732-000
4625|4625|5|Security|2774027|20140103151335.353332-000
4625|4625|5|Security|2774047|20140103153339.520120-000
4625|4625|5|Security|2774048|20140103153339.535719-000
Una vez obtenido el comando correcto armamos el script para testear los visores de sucesos de windows con nagios:
# vi check_wmi_eventWindows.sh
#!/bin/bash
#
# Script creado el 03-01-2013 por Hernán Tirado
# Descripción: Chequea por WMI el visor de sucesos de windows del día actual
# Verifica si hay mas de 10 loguins erroneos en el visor de sucesos => Critical
# Verifica si hay mas de 5 loguins erroneos en el visor de sucesos => Warning
#
# NOTA:
# Tener en cuenta que si el visor de suscesos es muy largo la query tarda y se corta
#
# Setear las variables de entorno antes de ejecutarlo.
################## INICIO DE CONFIGURACION DE VARIABLES
# Ruta de ubicación del comando wmic:
WMIC=/usr/bin/wmic
# Fecha de HOY:
HOY=`date +%d/%m/%Y`
# Usuario administrador del windows:
USER=
# Contraseña del usuario administrador de windows:
PASSWORD=
# Nombre de host ó ip del windows:
HOST=jdeenterprise
# Tipo de Visor de Suceso (Application, Security, Setup, System):
EVENT_TYPE='security'
# Tipo de Evento (Ej: 4625 testea loguins erroneos):
ID_EVENTO=4625
################## FIN DE CONFIGURACION DE VARIABLES
# Ejecución del comando WMIC:
CANT_ERRONEA=`$WMIC -U $USER%$PASSWORD //$HOST "select EventCode,EventIdentifier,EventType,TimeGenerated from Win32_NTLogEvent where EventCode='$ID_EVENTO' AND Logfile='$EVENT_TYPE' AND TimeGenerated>='$HOY'" | grep -v CLASS | grep -v Event | wc -l`
# Testeamos los valores que devuelve, si:
# CANT_ERRONEA <= 5 => OK (exit 0)
# CANT_ERRONEA > 5 => WARNING (exit 1)
# CANT_ERRONEA > 10 => CRITICAL (exit 2)
if [ $CANT_ERRONEA -lt 5 ]; then
{
echo OK - Cantidad de Logins Erroneos = $CANT_ERRONEA;
exit 0;
}
fi
if [ $CANT_ERRONEA -gt 10 ]; then
{
echo CRITICAL - Cantidad de Logins Erroneos = $CANT_ERRONEA;
exit 1;
}
fi
if [ $CANT_ERRONEA -gt 4 ]; then
{
echo WARNING - Cantidad de Logins Erroneos = $CANT_ERRONEA;
exit 1;
}
fi
En el commands de nagios agregamos lo siguiente:
# vi /etc/nagios/commands.cfg
define command{
command_name check_wmi_eventWindows.sh
command_line $USER1$/check_wmi_eventWindows.sh
}
En el services de nagios agregamos lo siguiente:
# vi /etc/nagios/services.cfg:
define service{
use generic-service,srv-pnp
host_name nombre_de_host
service_description Check_Bad_Logins
check_command check_wmi_eventWindows.sh
}
Chequeamos la config de nagios y si no da errores, reiniciamos el servicio:
# bin/nagios -v /etc/nagios.cfg
...
Total Warnings: 0
Total Errors: 0
...
# /etc/init.d/nagios reload
Running configuration check...done.
Reloading nagios configuration...done
NOTA: Tener en cuenta que en Windows debe estar habilitada la auditoría de logins erroneos. En esta entrada del blog les dejo como habilitarlo: http://www.redes-seguridad.com.ar/2014/01/logins-erroneos-en-windows-event-viewer.html
jueves, 2 de enero de 2014
Obtener Serial Number Remoto con wmic
En este post ya hemos visto como obtener el serial number de nuestra pc con wmic:
http://www.redes-seguridad.com.ar/2011/08/obtener-serial-number-del-server-por.html
También podemos hacer lo mismo para obtener el serial number remoto por WMI con el siguiente comando:
http://www.redes-seguridad.com.ar/2011/08/obtener-serial-number-del-server-por.html
También podemos hacer lo mismo para obtener el serial number remoto por WMI con el siguiente comando:
C:\Users\morsa>wmic /user:administrador /node:nombre_pc_remota bios get serialnumberEscriba la contraseña :**********SerialNumberAGXT8T2
Suscribirse a:
Entradas (Atom)















