How to check disk space for Nagios - nagios

How to check disk space manually in the Host management screen in nagios.

There seems to be a check_disk_space plugin for that.

Related

Is it possible to read android mobile device RAM content?

Is it possible to read android mobile device RAM content.
I am able to see passwords in RAM using HxD editor.
Is it possible to view the password using any tool on device?
Just taking a heap dump of ram with android studio dude.
You take the heap dump and seek the package name you are looking for and probably you can find passwords and whatever is in RAM.

Is there a way to get available disk space in Silverlight?

I'm currently trying to determine the available disk space from my Silverlight application.
My app can download a lot of data (video files) and obviously, this can fail if the disk space isn't there.
I know I can catch exceptions on writes, but that will not lead to a very user-friendly experience, because the information will come too late and cause useless waits.
In regular .NET, I would be using DriveInfo (see How do I retrieve disk information in C#? for an example), but that class isn't present as of Silverlight 5, even in elevated trust mode.
So, is there a way to determine the available space on a drive in Silverlight?
Update:
I'm fine with requiring Elevated Priviledges for my application.
I'm also fine with Silverlight 5 only solutions.
I need something that works on both Windows and Mac OS, so PInvoke/COM interop is not an option.
There has been filebrowser demos out there written in Silverlight but they would run with elevated trust.
That means that you would have to make the user immediately suspicious of your application when they first run it.
It's probably a better user experience to just have a well worded error message for when the user runs out of space.
Another option would be to try an increase the isolated storage quota by the size of the biggest video available.
http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.increasequotato(v=vs.95).aspx
Then when that fails just let the user know that no more space can be allocated for the app had that he may need to delete older videos.
I'm adding my answer here to sum up my discoveries:
TL/DR: there is no easy way to get available disk space in Silverlight 5 that is cross-platform (Windows/Mac OS).
You can't get available disk space with standard Silverlight calls. DriveInfo is missing from Silverlight 5, elevated privileges don't come into account here.
Quota is useless for that kind of issue, it doesn't take into account available disk space.
There are workarounds for Windows only, requiring elevated trust, using P/Invoke into Win32.
For a detailed support of filesystem, see this article: http://www.codeproject.com/KB/silverlight/FileExplorerInSilverlight.aspx
Fall-back is to check for exceptions when writing files and present the user with a message at the time of writing. People have also suggested pre-writing the file when the download start to ensure sufficient disk space.

How to install a font without logging off or rebooting a PC?

Is there a way or an API to install a font on the PC for every user, without logging off or restarting the PC?
See the MSDN document, Font Installation and Deletion, for full details. In summary:
Copy the font file to the fonts directory (%windir%\fonts).
Call AddFontResource() to ensure the font is immediately available.
Broadcast the WM_FONTCHANGE message.
Thanks to #Alex K for cleaning this up and adding the fine detail.

VMWare-Mount not recognizing virtual disks

I have two disks as .vmdk files, and four as .vdi files. I can boot virtual machines on them with Sun xMV VirtualBox, and they work just fine. However, I want to mount them on my local computer so I can read some files off of them without starting a virtual machine. I downloaded the vmware-mount utility, but I get this error:
Unable to mount the virtual disk. The disk may be in use by a virtual
machine, may not have enough volumes or mounted under another drive
letter. If not, verify that the file is a valid virtual disk file.
Thinking it's a problem with the utility, I downloaded the SDK and made my own simple program in C to try to mount a disk. It just initializes the API, connects to it, then attempts to open the disk. I get this error, once again claiming it is not a virtual disk:
**LOG: DISKLIB-DSCPTR: descriptor above max size: I64u
**LOG: DISKLIB-LINK : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-CHAIN : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-LIB : Failed to open 'f:\programming\VMs\windowstrash.vdi' with flags 0x1e (The file specified is not a virtual disk).
** FAILURE ** : The file specified is not a virtual disk
The files are clearly virtual disks, though, since I can actually mount and use them with a virtual machine. I tried detaching them from any VMs and trying again, but I got the same results.
Any ideas? Maybe the "descriptor above max size" is a hint?
.vdi is a VirtualBox supported format, but not supported by VMWare.
The .vmdk files are VMWare images - you should be able to load them fine using the vmware tool (VirtualBox supports these too, but the converse is not true).
However, if you are trying to just mount the VDI image somehow....
Try this blog
http://bethesignal.org/blog/2011/01/05/how-to-mount-virtualbox-vdi-image/
This is what you exactly should watch, if you wanna get this done within seconds.
I only posted this, since the other people who visit this page would find it easier.
Thanks.
In a case of removal of this blog in Future, posting the content briefly here would be helpful. So I would extract the contents and post it here as well.
Be the super user
sudo su
Load the nbd kernel module. - the network block device module
modprobe nbd
run qemu-nbd, which is a user space loopback block device server for QEMU-supported disk images. Basically, it knows all about weird disk image formats, and presents them to the kernel via nbd, and ultimately to the rest of the system as if they were a normal disk.
qemu-nbd -c /dev/nbd0 <vdi-file>
That command will expose the entire image as a block device named /dev/nbd0, and the partitions within it as subdevices. For example, the first partition in the image will appear as/dev/nbd0p1.
Now you could, for instance, run cfdisk on the block device, but you will most likely want to mount an individual partition.
mount /dev/nbd0p1 /mnt
When you’re done, unmount the filesystem and shut down the qemu-nbd service.
umount /mnt
qemu-nbd -d /dev/nbd0

file reallocation tool for ntfs

I have an XP Virtual Machine and some of the files on the disk are allocated after a long free space, so when i try to reduce the size of the harddisk file of the VM.
I tried to defrag the disk but it jus put most of the file at the first sectors of the disk and left the other files almost at the end of the disc.
Do you know a tool, or a way to, that allow me to move this files closer to the others at the beginig of the disk.
Why do you want to move the files? If it's to make space on the hard drive for a new partition, then you want a partition resizing tool. gparted is an easy to use, free graphical partition manager. It supports NTFS resizing - see this tutorial for an example. There are lots of others, but gparted is the only one I have direct experience with.

Resources