Filed under: Linux, Linux Commands, Network Monitoring, VMWare, centreon | Tags: /etc/ntp, Daemon, hwclock, NTP, ntp.conf, NTPD, ntpdate, ntpq, ntptime, sync
Another one of my public notes,
#First Configure your ntp servers for the ntp daemon. vim /etc/ntp.conf #Chose the options that are going to work best in your case #We usualy remove the local clock entry and add two new ntp servers #Add your local / remote ntp server like this. #server [server address, either hostname or ip] server 10.0.0.2 #or server hostname.domain.ext #save the settings. #next check if the ntp daemon is started during system startup for all levels #that enable networking (235) chkconfig --list ntpd ntpd 0:off 1:off <strong>2:on 3:on</strong> 4:off <strong>5:on</strong> 6:off #If ness. add the ntpd daemon to the required levels using; chkconfig --level 235 ntpd on #Next sync the system clock with the ntp daemon. BE CAREFULL BEFORE APPYING! #If the NTP servers time is in the PAST, this step might cause problems when forced #Readup on ntp how to solve this situation. (yes there is a way) ntpdate 10.0.0.2 #You own addres naturally #Next enable the ntp daemon to take over the sync task. service ntpd start #or /etc/init.d/ntpd start #To wrap it all up, its nice to sync the hardware clock as well using this step. hwclock --systohc (read 'System to Hardwareclock') #in case you need to manually set the timezone correctly #You might create the correct link from the #usr/share/zoneinfo/?/? to the /etc/localtime Like this ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime #Hope this helps you as much as it helped me in the past #Check to see if the NTPd is working can be done #using the following command ntpq ntpq>peers
Filed under: Windows 7 Professional, Windows Compontents | Tags: 120, 7, Drivers, Generic, M, Nvidia, NVS, PnP, Professional, Quadro, windows
Oke, first off this I will not guarantee that this will not cause any problems in the future, or that this method will work for you!
As you might have noticed there are no supported Quadro drivers for windows 7 at this very moment, But do check the vendor site for any updates before attempting this work arround.
When to apply
1. Setup halts with an error stating the opperating system isnt correct.
What to try first?
1. Try the Vista Drivers first, they usually install without any error messages. This is still no guarantee that the driver will function properly.
WARNING!
If your display isnt working afterward, do use the “Savemode” option (F8/boot options) to rollback the driver installation. Be sure to understand this before attempting the installation. Creating a restore point might also work out for you.
Work-Arround
1. oke, download the drivers for your system (Mine where on the Dell site as expected ![]()
2. Unpack the drivers to your disk (c:\dell\drivers\#####\, or c:\NVIDIA\)
3. Find the “Setup.exe” file
4. Rightclick it, and find the tab compatibility
5. Select “Windows Vista [distr.] SP3″
6. Select Apply > Ok.
7. Rightclick the setup.exe again (if the next option doesnt show, press hold the left shift key while right clicking)
8. Select “Run as administrator”
9. Follow the Installer, and reboot afterward as usual.
Any keynotes, other solutions, other sources? Please be so kind to share them
Good Luck and hope this helped
Filed under: Linux, Nagios / Centreon, Network Monitoring, centreon | Tags: bash, Daemon, how, Init, init.d, init.rd, nagios, ndo, Restart, Script, Scripting, start, startup, stop, to, Using
previously I wrote an article on how to create a deamon script for ndo. But when you are using Centreon the only “nice” way to do this is by altering the Nagios startupscript to include the ndo part.
Here is what i have done to make this possible.
First i wrote a function to find the PIDs for the ndo deamon process based on a specific config. In this one the config is hardcoded,
but you might also replace the $NagiosNdoConfig with $1 instead and call the function like;
getNdoPid “/usr/local/nagios/etc/yourconfig.cfg”
getNdoPid ()
{
#Declare a var containing the correct ndo PID, there are processes being forked from ndo so we need to
#do some awk filtering also to fetch the correct one.
#Not that the parent process always has a parent pid "1" so we use that to filter the parent from the childs.
ndoPID=`ps -ef | grep $NagiosNdoConf | grep "?" | awk -F ' ' '{if($3 == '1') print $2}'`
#next we validate if we got an pid returned to us, and fill a wrapper that we will use like $? that ill convieniently call "ls" LastState.
if [[ "$ndoPID" == '' ]]; then
ls=1;
else
ls=0;
fi
}
Next using the getNdoPid function u wrote another two functions to start and to stop the ndo daemon. I choose this method so i can include these function inside the existing start stop scripting used by nagios. In effect when you start nagios, th start case select is used which will call our ndo start script.
The ndo kill function
kill_ndo ()
{
#Find the actual PID
if [[ "$ndoPID" == '' ]]; then
#No process running to kill...
ls=0;
else
kill $ndoPID;
sleep 2 #parent needs some time to kill the child processes if any
getNdoPid
if [[ "$ls" == '1' ]]; then
ls=0;
else
ls=1;
fi
fi
}
and the start portion…
The ndo start function
start_ndo ()
{
#always make sure ndo isnt running!
$NagiosNdo -c $NagiosNdoConf;
if [[ "$?" == '0' ]]; then
ls=0;
else
ls=1;
fi
}
Again i am using the ls (laststate) var to save the last state of the executed command. This is important because the state of a command can only be tested right after execution of that command. by using the ls var i make sure i am always testing the correct result. this is because the $? is also overwritten when performing an var assignment, if test etc.
Next I added a few vars for configuration, stuff like where the ndo2db bin is located, and the config file.
NagiosNdo=/usr/sbin/ndo2db; NagiosNdoConf=/usr/local/nagios/etc/ndo2db.cfg;
naturally the NDO bin could also be found like;
NagiosNdo=`which ndo2db`;
Bu this will require the ndo2db bin to be somewhere in the path var. We are not sure this is always the case because there is no consensus on where these nagios bins should be placed. This may vary from distro to distro and from user to user. In my case, it being placed inside /user/bin this whould also work.
I also extended the functionality of the startupscript by adding new options to start, stop and restart the ndo deamon by using the nagios startupscript. This is what i did.
inside the “case” statement where the “/etc/init.d/nagios args” are tested i added some new options namely “startndo, stopndo, restartndo” and this is what it looks like.
For the option “/etc/init.d/nagios startndo”
startndo)
getNdoPid
if [[ "$ls" == '1' ]]; then
start_ndo
if [[ "$ls" == '0' ]]; then
echo 'NDO deamon started succesfully';
exit 0;
else
echo 'Failed to start NDO, check your logging for more info';
exit 1;
fi
else
echo "Ndo deamon allready running with PID : $ndoPID";
exit 1;
fi
;;
for the “/etc/init.d/nagios stopndo” option
stopndo)
getNdoPid
if [[ "$ls" == '1' ]]; then
echo "$ls";
exit 1;
else
kill_ndo
sleep 2 #it needs some time to kill the childs (that get ppid 1 when the parent quits)
getNdoPid
if [[ "$ls" == '1' ]]; then
echo "Ndo stopped succesfully";
exit 0;
else
echo "Unable to kill ndo, please review you logging";
exit 1;
fi
fi
;;
And a restart option “/etc/init.d/nagios restartndo”
restartndo)
$0 stopndo
$0 startndo
;;
To include the start and stop options in the nagios start and stop process all you need to do is add the start and or stop options in there.
Here is an example
start)
echo -n "Starting nagios:"
$NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
if [ $? -eq 0 ]; then
su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"
rm -f $NagiosCommandFile
touch $NagiosRunFile
chown $NagiosUser:$NagiosGroup $NagiosRunFile
$NagiosBin -d $NagiosCfgFile
if [ -d $NagiosLockDir ]; then touch $NagiosLockDir/$NagiosLockFile; fi
#chmod 777 $NagiosCommandFile
start_ndo
echo " done."
exit 0
else
echo "CONFIG ERROR! Start aborted. Check your Nagios configuration."
exit 1
fi
;;
#Stop portion
stop)
echo -n "Stopping nagios: "
pid_nagios
killproc_nagios nagios
kill_ndo
# now we have to wait for nagios to exit and remove its
# own NagiosRunFile, otherwise a following "start" could
# happen, and then the exiting nagios will remove the
# new NagiosRunFile, allowing multiple nagios daemons
# to (sooner or later) run - John Sellens
#echo -n 'Waiting for nagios to exit .'
for i in 1 2 3 4 5 6 7 8 9 10 ; do
if status_nagios > /dev/null; then
echo -n '.'
sleep 1
else
break
fi
done
if status_nagios > /dev/null; then
echo ''
echo 'Warning - nagios did not exit in a timely manner'
else
echo 'done.'
fi
rm -f $NagiosStatusFile $NagiosRunFile $NagiosLockDir/$NagiosLockFile $NagiosCommandFile
;;
status)
pid_nagios
printstatus_nagios nagios
;;
Now when i start and stop nagios using the centreon “start / stop / reload” options my ndo daemon is also started / stopped. Ps. This manual uses Nagios 3.0 and Centreon 2.2
This is what a restart looks like
[root@UX127 var]# service nagios restartndo Ndo stopped succesfully NDO deamon started succesfully
Rgrds,
Filed under: Uncategorized | Tags: drives, explorer, hiding, In, registry, windows
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]
Drives refference (Binairy), please not that the registry entry (Reg_Dword) is HEX by default.
A: 1, B: 2, C: 4, D: 8, E: 16, F: 32, G: 64, H: 128, I: 256, J: 512, K: 1024, L: 2048, M: 4096, N: 8192, O: 16384, P: 32768, Q: 65536, R: 131072, S: 262144, T: 524288, U: 1048576, V: 2097152, W: 4194304, X: 8388608, Y: 16777216, Z: 33554432, ALL: 67108863
If multiple drives are hidden, then the sum of values apply to the key. I.e.
Hiding “C: & D:”
C: 4 + D: 8 = 12, in which case the regkey should get the value “12″ binairy or “12″ Hex
Filed under: VBS, VMWare | Tags: All, Restart, services, VBScript, VM, VMWare
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\”&strComputer&”\root\cimv2″)
Set colListOfServices = objWMIService.ExecQuery(“Select * from win32_Service where Name Like ‘VM%’”)
IntSleep = 15000
For Each objService in colListOfServices
If UCase(Left(objService.name, 1)) > “N” then
objService.StopService()
WScript.Sleep intSleep
objService.StartService()
strMsg = strMsg & vbCr & objService.name & ” Restarted.”
End If
Next
Wscript.Echo strMsg
Sure you can tweak and modify it as you see fit
Filed under: Linux, Nagios / Centreon, PHP, centreon | Tags: Add, alert, alert.mp3, alter, audiable, audio, audioble, centreon, change, critical, error.mp3, hack, sound, tacticalOverview, unkown, warning, when
browse to your centreon install location web dir default;
~>cd /usr/local/centreon/www/
browse to the tacticalOverview dir.
~>cd /include/home/tackticalOverview
Open the file tacticalOverview.php
~>vi /tacticalOverview.php
Add the following code in the bottom of the file.
/*
* Audiable allert on Warning, Critical, Unknown states.
* Values are recalculated because we dont accept NULL as an answer
*/
if(!isset($_SESSION['amis_alert'])){
$_SESSION['amis_alert'] = false;
}
foreach($SvcStat as $key => $val){
if(($key == 1) || ($key == 2) || ($key == 3)){
$sum = $val - $svcAck[$key];
if($sum >= 1){
if(!$_SESSION['amis_alert']){
print('<script>window.open(\'./include/home/tacticalOverview/alert.ihtml\', \'alert\',\'width=180,height=20,scrollbars=no,toolbar=no,location=no\');</script>');
$_SESSION['amis_alert'] = true;
break;
}
break;
}else{
print('<script>window.open(\'./include/home/tacticalOverview/closeme.ihtml\', \'alert\',\'width=180,height=20,scrollbars=no,toolbar=no,location=no\');</script>');
$_SESSION['amis_alert'] = false;
}
}
}
If you want this tidy add additional template entries. I was to lazy for that
Save the file and add the alert.ihtml
~>vim ./alert.ihtml
Add the following code
<html> <head></head> <body> <div> <object type="application/x-shockwave-flash" data="../../../mp3player.swf" height="20" width="180"><param name="FlashVars" value="mp3=../../../error.mp3&autoplay=1&loop=1&showslider=0"/></object></div> </body>
Save the file and add the closeme.ihtml
~>vim closeme.ihtml
Add the following code
<html> <head></head> <body> <script>window.close();</script> </body>
Go back to the www dir
~>cd /usr/local/centreon/www
download the a nice error.mp3 (yeah you need to rename it
wget http://www.freeinfosociety.com/media/sounds/142.mp3
~>cp ./142.mp3 ./error.mp3
Download the flash player (yeah i renamed this one too
~>wget http://flash-mp3-player.net/medias/player_mp3_maxi.swf
cp ./player_mp3_maxi.swf ./mp3player.swf
This should be all
Hope this helps, and sure do edit the scripts with nicer methods but please do me a favour by keeping us up-to-date with nice addons
Filed under: Uncategorized | Tags: collaboration, communication, google, wave, web5
the future for any cyberbully and any form of business fraud.
Good thing that “you n00b” will be automaticly be translated in “you unskilled user”
Chech it out yourself at http://wave.google.com
All in all, pretty cool web5 app!!
Filed under: Linux, Linux Commands, Uncategorized | Tags: #!/usr/bin/bash, bash, for, function, howto, Linux, one, pause, programming, Scripting, second, shell, tip, trick, Using, wait
This is an alternative for sleep [i]n[/i]
function wait(){
BOGUS=`read -n1 -t1 any_key`
BOGUS=''
}
If you have sleep available, you rather use sleep then this method! i.e.
$N=1;
while :
do
echo "$N"
sleep 1
let N=$N+1;
done
“Performance”
• Are you monitoring freespace or usedspace?
• Is every free CPU cycle a wasted one, or one waiting to be used?
• Do you like mountains or Hills in your graphs?
• Capacity planning? or Performance tuning?